Skip site navigation (1)Skip section navigation (2)
Date:      03 Jun 2003 00:10:47 -0400
From:      Adam <blueeskimo@gmx.net>
To:        Joe Marcus Clarke <marcus@marcuscom.com>
Cc:        FreeBSD User Questions List <freebsd-questions@freebsd.org>
Subject:   Re: Listing installed ports without any ports dependent on it
Message-ID:  <1054613446.16970.83.camel@jake>
In-Reply-To: <1054612388.316.12.camel@gyros>
References:  <1054590763.16970.5.camel@jake> <1054610958.16970.79.camel@jake>	 <1054612388.316.12.camel@gyros>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2003-06-02 at 23:53, Joe Marcus Clarke wrote:

> It's not Python, but this script should work.
>
> #!/bin/sh
>
> for i in `pkg_info | cut -f1 -d ' '`; do
>    if [ -z "`pkg_info -qR ${i}`" ]; then
>       echo ${i}
>    fi
> done

Excellent! This does exactly what I was after! 

Here's how I run it:
echo Installed before:
pkg_info |wc -l
sleep 3
/home/eskimo/bin/pkg_nodeps.sh |less
echo Installed after:
pkg_info |wc -l

The basic idea is to thumb through the list and spot the ports that are
no longer needed, then copy & paste the port name to a seperate terminal
and pkg_delete it. This is a great way to efficiently remove unneeded
ports.

Thanks Marcus!

-- 
Adam <blueeskimo@gmx.net>



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