From owner-freebsd-questions@FreeBSD.ORG Mon Nov 5 03:05:25 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 F137016A469 for ; Mon, 5 Nov 2007 03:05:25 +0000 (UTC) (envelope-from brett@net24.co.nz) Received: from srv.exchange.net24.net.nz (srv.exchange.net24.net.nz [210.55.4.16]) by mx1.freebsd.org (Postfix) with ESMTP id 80C2D13C4A3 for ; Mon, 5 Nov 2007 03:05:25 +0000 (UTC) (envelope-from brett@net24.co.nz) Received: from [192.168.1.100] ([210.55.30.56]) by srv.exchange.net24.net.nz with Microsoft SMTPSVC(6.0.3790.3959); Mon, 5 Nov 2007 15:49:26 +1300 Message-ID: <472E855D.1030803@net24.co.nz> Date: Mon, 05 Nov 2007 15:52:13 +1300 From: Brett Davidson Organization: Net24 Limited User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Robert Huff References: <472E77AC.9060200@net24.co.nz> <18222.31287.897833.3437@jerusalem.litteratus.org> In-Reply-To: <18222.31287.897833.3437@jerusalem.litteratus.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Nov 2007 02:49:26.0843 (UTC) FILETIME=[7AD420B0:01C81F56] Cc: freebsd-questions@freebsd.org Subject: Re: Is there a way to compare what is in the ports tree with what is installed? 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: Mon, 05 Nov 2007 03:05:26 -0000 Robert Huff wrote: > Brett Davidson writes: > > >> ie. If I had a particular version of the ports tree on a server, >> how could I check to see if any of the programs in that tree were >> actually installed? >> >> Is there a simple command or sequence of commands to do this? >> > > dir /var/d/pkg | grep > > > Robert Huff > Ah. Not quite but thanks for telling me the location of the pkg directory (btw, it's var/db/ I've now worked out how to get what I want via : cd /var/db/pkg for i in * do MATCHES=`grep -c $i /usr/ports/INDEX-6` if [ $MATCHES -gt 0 ] then #echo "Pattern $i Matched $MATCHES times" else echo "Pattern $i not matched" fi done In my case I was looking for files that weren't at the same revision level as the ports tree but both options are accounted for. Thanks all. -- Brett Davidsonls -la Systems Engineer -- Net24 Limited Web: www.net24.co.nz Phone: 0800 5000 24 | DDI: +64 3 962 9518 -- // web hosting / email hosting / data backup // our reputation for reliability precedes us This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender.