Skip site navigation (1)Skip section navigation (2)
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

--pq19ZxDHUu
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

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



--pq19ZxDHUu
Content-Type: application/octet-stream
Content-Description: Python program to find ports with no dependents.
Content-Disposition: attachment;
	filename="find-unrequired-ports.py"
Content-Transfer-Encoding: base64

IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgppbXBvcnQgc3lzCgpwcmludG1lID0gRmFsc2UKZm9y
IHggaW4gc3lzLnN0ZGluOgogICAgaWYgeC5zdGFydHN3aXRoKCJJbmZvcm1hdGlvbiBmb3Ig
Iik6CiAgICAgICAgaWYgcHJpbnRtZToKICAgICAgICAgICAgcHJpbnQgbmFtZQogICAgICAg
IG5hbWUgPSB4LnNwbGl0KClbMl1bOi0xXQogICAgICAgIHByaW50bWUgPSBUcnVlCiAgICBl
bGlmIHguc3RyaXAoKToKICAgICAgICBwcmludG1lID0gRmFsc2UK

--pq19ZxDHUu
Content-Type: text/plain; charset=us-ascii
Content-Description: .signature
Content-Transfer-Encoding: 7bit


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

--pq19ZxDHUu--



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