Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Nov 2007 15:52:13 +1300
From:      Brett Davidson <brett@net24.co.nz>
To:        Robert Huff <roberthuff@rcn.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Is there a way to compare what is in the ports tree with what is installed?
Message-ID:  <472E855D.1030803@net24.co.nz>
In-Reply-To: <18222.31287.897833.3437@jerusalem.litteratus.org>
References:  <472E77AC.9060200@net24.co.nz> <18222.31287.897833.3437@jerusalem.litteratus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <portname>
>
>
> 				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.




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