Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2007 16:39:27 -0600
From:      James <jamesh@lanl.gov>
To:        Robert Huff <roberthuff@rcn.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: I performed an rm -r on /var/lib/pkg
Message-ID:  <1192142367.33933.32.camel@secretariat.lanl.gov>
In-Reply-To: <18190.41045.40653.528498@jerusalem.litteratus.org>
References:  <1192134379.33933.9.camel@secretariat.lanl.gov> <470E8D3A.8010508@daleco.biz> <1192136857.33933.18.camel@secretariat.lanl.gov> <20071011211317.GA24658@owl.midgard.homeip.net> <1192138145.33933.21.camel@secretariat.lanl.gov> <18190.41045.40653.528498@jerusalem.litteratus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2007-10-11 at 18:14 -0400, Robert Huff wrote:

> James writes:
> 
> >  What has happened, though, is I've never ran rm in
> >  /usr/ports/distfiles.  I'm going to think for a little bit about
> >  a script that can move through /usr/ports/distfiles and reinstall
> >  everything that exists there.
> 
> 	Having been in almost the identical situation for different
> rasons, I sympathize.
> 	Yes, this will involve a sweep through /usr/ports distfiles.
> If you haven't ever deleted anything, I suggest a prelimiary manual
> run deleting everything but the most recent version.  This has a
> down-side, but it will prevent cluttering the rebuilt system with
> unused ports.


/usr/ports/distfiles is definitely looking promising. awk is too damn
painful to work with, so I'm going to dust off my perl skills.

Hell, this could actually turn out to be fun. And if I write the script
properly, it might make a nice disaster recovery tool
for /usr/ports/ports-mgmt - it can be called
"WhenYou'reAnIdiotLikeJamesWasOnFreeBSDQuestions"



Well, if you figure out what ports you have installed, you can
regenerate the 

> pkgdb using:
> 
> make -DNO_BUILD -DNO_INSTALL generate-plist fake-pkg
> 
> for each port.
> I just tested that using a temporary PKG_DBDIR. In case you wanna see what 
> happens, here's what I did:
> 
> mkdir -p /tmp/var/db/pkg
> cd /usr/ports/shells/bash
> env PKG_DBDIR=/tmp/var/db/pkg make -DNO_BUILD -DNO_INSTALL \
> 	generate-plist fake-pkg
> 
> 

Wow, that's great! I understand that it has the caveats that you mentioned, but it's
*at least* a fantastic start. 

James



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1192142367.33933.32.camel>