From owner-freebsd-questions@FreeBSD.ORG Fri Oct 12 16:57:28 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 BF98516A41A for ; Fri, 12 Oct 2007 16:57:28 +0000 (UTC) (envelope-from jamesh@lanl.gov) Received: from mailwasher.lanl.gov (mailwasher.lanl.gov [204.121.3.2]) by mx1.freebsd.org (Postfix) with ESMTP id 92B1813C455 for ; Fri, 12 Oct 2007 16:57:28 +0000 (UTC) (envelope-from jamesh@lanl.gov) Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by mailwasher.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l9CGvQLI000755; Fri, 12 Oct 2007 10:57:27 -0600 Received: from oppie-mail.lanl.gov (oppie-mail.lanl.gov [128.165.4.123]) by mailrelay2.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l9CGvPtT011387; Fri, 12 Oct 2007 10:57:25 -0600 Received: from [128.165.86.10] (secretariat.lanl.gov [128.165.86.10]) by oppie-mail.lanl.gov (Postfix) with ESMTP id 496091F8002; Fri, 12 Oct 2007 10:57:22 -0600 (MDT) From: James To: Robert Huff 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> Organization: Los Alamos National Laboratories Date: Fri, 12 Oct 2007 10:57:59 -0600 Message-Id: <1192208279.33933.84.camel@secretariat.lanl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 FreeBSD GNOME Team Port X-CTN-5-MailScanner-Information: Please see http://network.lanl.gov/email/virus-scan.php X-CTN-5-MailScanner: Found to be clean X-CTN-5-MailScanner-From: jamesh@lanl.gov X-Spam-Status: No Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 Reply-To: jamesh@lanl.gov List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2007 16:57:28 -0000 This isn't quite as simple as I'd hoped it'd be to fix. Here's my findings thus far (I haven't started writing my script yet, but I will later today): 1. /usr/ports/distfiles contains everything I need 2. distfiles contains several versions of some packages, but that's pretty trivial to resolve. 3. distfiles contains some packages whose source tarballs are named *differently* to the packages themselves, such as unrar. It's number 3 that's getting me. It looks like the simplest thing might be an if statement: if (make search name=$PACKAGE) score! else grep -r $PACKAGE /usr/ports But before I go that far, I wanted to see if anyone had an alternate idea for what might work. James