Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jul 2002 13:35:49 +0200
From:      Rahul Siddharthan <rsidd@online.fr>
To:        arch@freebsd.org
Subject:   Cleaning old packages (was: Package system flaws?)
Message-ID:  <20020709113549.GA249@lpt.ens.fr>

next in thread | raw e-mail | index | archive | help
I'm not subscribed to this list but I happened on this discussion in
the archives today.

One mild peeve I've had about FreeBSD's ports system is the difficulty
of deleting an old package which has been overwritten by a new
package.  Suppose you had installed foo-1.3.1, and then another port
you were installing overwrote this with foo-1.3.2.  Now both are
registered in /var/db/pkg but you can't pkg_delete foo-1.3.1 because
it will remove files with common names from foo-1.3.2.

I've been playing with gentoo linux a bit recently and it has a
command to take care of this.  The idea seems simple enough: it looks
at the mtimes, and makes sure that it is never deleting a file which
belongs to the most recently installed version.

So what about doing something like this: 
1. look at the mtimes of all the /var/db/pkg/foo-*
2. pick the second-most-recent of these (say, if you have foo-1.3.0,
   1.3.1 and 1.3.2 installed in that order, take the mtime of foo-1.3.1)
3. Delete all files listed in +CONTENTS for foo-1.3.0 and foo-1.3.1 which 
   are older than this.  (Since the package registration is the last
   step, I assume that all files belonging to foo-1.3.1 will be older
   than the files in /var/db/pkg/foo-1.3.1?)

Would this work, or is there some obvious problem here?  It seems to
me that this is totally "safe" in that it will never delete a file
belonging to the most recent version (unless your clock was wrong
when it was installed).  It may leave some older files intact if
they've been touched in the meantime.  

There are other features I like about gentoo (I'll list them if anyone
is interested) but I think they would require major modifications to
the ports system (some of them are supported by portupgrade, though).
As it stands, I think the ports system is in some ways more intuitive
-- it's easier to do the configure, build etc yourself and supply your
own options on the way if you want to.

- Rahul

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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