From owner-freebsd-questions@FreeBSD.ORG Fri Oct 12 08:32:36 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25AE516A418 for ; Fri, 12 Oct 2007 08:32:36 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.freebsd.org (Postfix) with ESMTP id C56DE13C45A for ; Fri, 12 Oct 2007 08:32:35 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so1619712pyb for ; Fri, 12 Oct 2007 01:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; bh=bCztbdB/GwEovgZi3wOLqvWgDTsNEhD+rPiYq3rkxqo=; b=E3P12X8FWgSR5SczTPU7lPMRyE3ZJkkleIW3U5QbVW5NEhvBfF8E97G/k/2Kz0yyOeJceyD1VyFOyqAjW+c/h8rpfoGGlm61q6liPBWtGsBfg5JxTyuIJM0WABnxa/ZxOEecO9OkFF6A0m7DQJUcoW2St6lQhLlN8CXnyJZLEBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=TsU1sqVJKWgQqHguq1PxFD2Tmw1K5rlzY8e/etErz1ogTsf0KkioP5sHPrRoAtzM/xvEeRpW6bYHYsVcb5mWQmeZLiJH6HJgfvv8t19PGGFErQwEYeDRN5BJAKg80AzGx91BVz+KYz0UEjEzVaQ06qFcu+R/mO9+8S4JbMO3FhY= Received: by 10.65.52.1 with SMTP id e1mr5966221qbk.1192177954606; Fri, 12 Oct 2007 01:32:34 -0700 (PDT) Received: from ?192.168.1.3? ( [74.134.230.123]) by mx.google.com with ESMTPS id 38sm1252902nza.2007.10.12.01.32.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2007 01:32:33 -0700 (PDT) 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> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <1319c2db49de156de0214e0e449d78d4@gmail.com> Content-Transfer-Encoding: 7bit From: Joshua Isom Date: Fri, 12 Oct 2007 03:32:35 -0500 To: jamesh@lanl.gov X-Mailer: Apple Mail (2.624) Cc: freebsd-questions Subject: Re: I performed an rm -r on /var/lib/pkg X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2007 08:32:36 -0000 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.