Date: Sat, 5 Apr 2003 16:59:59 -0600 From: Mike Meyer <mwm-dated-1050015600.8a4947@mired.org> To: Adam <blueeskimo@gmx.net> Cc: freebsd-questions@freebsd.org Subject: Re: How to list installed ports that have no dependant ports Message-ID: <16015.24559.667912.675361@guru.mired.org> In-Reply-To: <1049582306.91991.30.camel@jake> References: <1049438180.27963.60.camel@jake> <16013.52484.125528.851826@guru.mired.org> <1049582306.91991.30.camel@jake>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
In <1049582306.91991.30.camel@jake>, Adam <blueeskimo@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
[-- Attachment #2 --]
#!/usr/bin/env python
import sys
printme = False
for x in sys.stdin:
if x.startswith("Information for "):
if printme:
print name
name = x.split()[2][:-1]
printme = True
elif x.strip():
printme = False
[-- Attachment #3 --]
--
Mike Meyer <mwm@mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16015.24559.667912.675361>
