How to list installed ports that have no dependant ports

Mike Meyer mwm-dated-1050015600.8a4947 at mired.org
Sat Apr 5 15:00:04 PST 2003


In <1049582306.91991.30.camel at jake>, Adam <blueeskimo at gmx.net> typed:
> On Fri, 2003-04-04 at 13:20, Mike Meyer wrote:
> > Since you want to delete them, why don't you just use pkg_delete on
> > them. If they something depends on them, they won't be deleted.
> 
> I do use pkg_delete, but the idea here is to effectively FIND the ports
> that have no ports dependent on them .. I've got 500+ installed ports to
> go through here .. Trying pkg_delete on all of them would take too long
> .. I need to narrow my search space considerably in order to do this
> effectively ..

Here's a simple python script for you. You'll need python 2.2 if you
haven't got it already. Feed it the output of "pkg_info -a -R" on
standard in, and it'll output the package names of all packages that
aren't required by other packages.

Don't forget that you may have packages which are only required by
packages that you don't want, so you need to iterate over the deletion
process multiple times.

	<mike


-------------- next part --------------
A non-text attachment was scrubbed...
Name: find-unrequired-ports.py
Type: application/octet-stream
Size: 255 bytes
Desc: Python program to find ports with no dependents.
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030405/80fd22a0/find-unrequired-ports.obj
-------------- next part --------------

-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.


More information about the freebsd-questions mailing list