Date: Fri, 12 Oct 2007 03:32:35 -0500 From: Joshua Isom <jrisom@gmail.com> To: jamesh@lanl.gov Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: I performed an rm -r on /var/lib/pkg Message-ID: <1319c2db49de156de0214e0e449d78d4@gmail.com> In-Reply-To: <1192142367.33933.32.camel@secretariat.lanl.gov> 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> <1192142367.33933.32.camel@secretariat.lanl.gov>
next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 11, 2007, at 5:39 PM, James wrote: > 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 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > If you don't run 'make clean' then you can look for the 'work' directory to know if you've installed it or not. But some of the port tools automatically run make clean for you so they would disappear. A simple 'find /usr/ports -type d -name work' would probably work well enough unless you wanted it all automated.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1319c2db49de156de0214e0e449d78d4>