Subject: Re: pkg/24188: A utility for removing leaf packages
To: None <roman@ontographics.com>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 01/23/2004 03:42:53
[ On Thursday, January 22, 2004 at 01:02:45 (+0100), roman@ontographics.com wrote: ]
> Subject: pkg/24188: A utility for removing leaf packages
>
> 
> When installing a package from pkgsrc, a lot of additional packages may be
> installed in order to satisfy dependency. When such a package is beeing
> removed, the dependency packages remain on the system. Another example is
> a package which depends on another package and in a later version that
> dependancy is removed.
> 
> It is difficult to track all dependencies and remove the depended
> packages manually, so after a while and a lot of installing and
> deinstalling packages it is very likely, that you end up with a lot of
> packages beeing installed that are not nessecary.

Try using "pkg_delete -R" when you remove packages that may depend on
other packages.

It should do what you want.

Perhaps something like this fix is all you need:  :-)

Index: delete/pkg_delete.1
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/usr.sbin/pkg_install/delete/pkg_delete.1,v
retrieving revision 1.31
diff -c -u -r1.31 pkg_delete.1
--- delete/pkg_delete.1	8 Sep 2003 08:57:56 -0000	1.31
+++ delete/pkg_delete.1	17 Jan 2004 02:18:11 -0000
@@ -17,7 +17,7 @@
 .\"
 .\"     from FreeBSD: @(#)pkg_delete.1
 .\"
-.Dd September 2, 2003
+.Dd January 16, 2004
 .Dt PKG_DELETE 1
 .Os
 .Sh NAME
@@ -126,14 +126,11 @@
 be set automatically to the installed location by
 .Xr pkg_add 1 .
 .It Fl R
-Like the
-.Fl r
-option, this does a recursive delete.
-The
-.Fl R
-option deletes the given package and any packages required by
-it, unless some other package still needs them.
-This can be used to delete a package and all the packages it needs.
+This option triggers a recursive delete of the given package and any
+packages it depends on, unless some other package still needs a
+dependent package.
+I.e. this option can be used to delete a package and all the
+now-unneeded dependent packages it needs.
 .It Fl r
 .Nm
 first builds a list of all packages that require (directly and indirectly)
@@ -141,6 +138,8 @@
 It then deletes these packages using
 .Nm
 with the given options before deleting the user specified package.
+I.e. this option can be used to delete a package and all of the packages
+which use the package to be deleted.
 .It Fl V
 Print version number and exit.
 .It Fl v


-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>