Call for comments - pkg_trans

Marcin Wisnicki mwisnicki+freebsd at gmail.com
Thu Jul 31 22:04:30 UTC 2008


On Thu, 31 Jul 2008 06:25:27 +0200, Ivan Voras wrote:

> Hi,
> 
> I apologize in advance if what I'm trying to do seems stupid or it has
> already existed since the Dawn of Time (i.e. when McKusick was in
> diapers) but I'd like your comments on this idea:
> 
> http://wiki.freebsd.org/IvanVoras/PkgTransProposal

Looking at your use cases I think what you are proposing is overkill.

* Install some large group of packages, like KDE or GNOME. Don't like it, 
want to delete all packages installed during the operation.

This could be achieved by tracking which ports were installed explicitly 
by user. I.e. when I type:
  (cd /usr/ports/x11/gnome2; make install)
or
  pkg_add -r gnome2

It will install gnome2 along with it's dependencies but in some way mark 
gnome2 package as installed by user, say, by creating /var/db/pkg/
gnome2-2.22/+USER_INSTALLED or even easier, by maintaing some special 
unremovable dummy package that would depend on all packages installed 
explicitly.

Then when you decide you want to get rid of gnome something like this 
could be implemented:

  pkg_deinstall -Ru gnome2-2.22

where option 'R' (already exists in pkg_deinstall but could be added to 
pkg_delete) means "Deinstall all those packages required by the given 
packages as well." and option 'u' would be something like "keep packages 
installed explicitly".

I think similar solution is/was used in Gentoo.

You can even approximate this behaviour with existing tools like 
pkg_rmleaves or pkg_cutleaves, though you will need to manually maintain 
a list of packages to keep.

* Install a newer version of postgresql, have an OMG moment and remember 
you need to dump the database with the old version and reaload it with 
the new version. Revert the install by deleting the new packages and 
reinstalling the old ones (i.e. undo a removal).

pkg_deinstall -R posgtresql-8.4.0; pkg_add postgresql-8.3.0

but you still need to figure out how to get old packages (portupgrade/
portinstall with option -P keeps all packages on disk).

Also if not all dependencies of postgres84 could be removed (because some 
other package needs them) then you could have a problem in either of 
schemes (yours and mine).



More information about the freebsd-ports mailing list