Keeping track of automatically installed dependency-only ports

Nikola Lecic nlecic at EUnet.yu
Thu Jun 14 23:22:46 UTC 2007


On Thu, 14 Jun 2007 09:54:18 +0200
Jeremie Le Hen <jeremie at le-hen.org> wrote:

> My request ismore subtle, I think.
> 
> Consider the following fake port tree:
> 
> port1     port2     port3*    port4
>   \        /   \      |      /
>    \      /     \     |     /
>     port12*      \    |    /
>                   \   |   /
> 		   port234*
> 
> A trailing * marks a port manually installed.
> 
> If I run "pkg_deinstall --upward-recursive port234", this will remove
> port234, port3 and port4 (at least I suppose, the manual page doesn't
> give the details).  But since I've installed port3 manually it's
> likely because I need it for some reason, therefore I don't want it
> to be deinstalled.

Yes, now I see what you want. For example, you want xmms, portupgrade
installs xmms+x1,x2... Then you install mplayer+y1,y2... with an option
that links xmms as its dependency; then you want 'pkg_deinstall mplayer'
to leave xmms intact.

At the first place, I think such a situation occurs extremly rare. 

However, assuming you have a list of 'never-deinstall' ports in a file
called EXCEPTIONS (such as 'xmms xfce4 firefox ...'), then

  pkg_deinstall -R -x `cat EXCEPTIONS` pkgname_glob

will do exactly what you want (and surely will do no harm). I recommend
you to study pkg_glob(1) to get an idea what you can add behind '-x'.

I think there is no tweaking of /usr/local/etc/pkgtools.conf that can
maintain your EXCEPTIONS list, since portupgrade doesn't make any
difference between ports it installs (as Robert has already told you).
If that's not true, let someone corrects me.

Maybe you can try to write a tiny wrapper script that will add a
pkgname_glob (passed as an argument to portinstall) to the EXCEPTIONS
list, since that glob surely belongs to it.

Of course, this is all very crude, but maybe can help a bit.

Nikola Lečić


More information about the freebsd-ports mailing list