From owner-freebsd-arch Tue Jul 9 4:35:56 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A75EB37B400 for ; Tue, 9 Jul 2002 04:35:52 -0700 (PDT) Received: from alix.lpt.ens.fr (bluerondo.lpt.ens.fr [129.199.122.217]) by mx1.FreeBSD.org (Postfix) with SMTP id 5F63D43E52 for ; Tue, 9 Jul 2002 04:35:51 -0700 (PDT) (envelope-from rsidd@lpt.ens.fr) Received: (qmail 322 invoked by uid 1001); 9 Jul 2002 11:35:49 -0000 Date: Tue, 9 Jul 2002 13:35:49 +0200 From: Rahul Siddharthan To: arch@freebsd.org Subject: Cleaning old packages (was: Package system flaws?) Message-ID: <20020709113549.GA249@lpt.ens.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i X-Operating-System: FreeBSD 4.6-PRERELEASE i386 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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