From owner-freebsd-ports@FreeBSD.ORG Wed Mar 26 13:18:24 2008 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 367A11065670 for ; Wed, 26 Mar 2008 13:18:24 +0000 (UTC) (envelope-from michel@lpthe.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id BF23F8FC12 for ; Wed, 26 Mar 2008 13:18:23 +0000 (UTC) (envelope-from michel@lpthe.jussieu.fr) Received: from parthe.lpthe.jussieu.fr (parthe.lpthe.jussieu.fr [134.157.10.1]) by shiva.jussieu.fr (8.14.2/jtpda-5.4) with ESMTP id m2QDI1Po007812 ; Wed, 26 Mar 2008 14:18:03 +0100 (CET) X-Ids: 166 Received: from niobe.lpthe.jussieu.fr (niobe.lpthe.jussieu.fr [134.157.10.41]) by parthe.lpthe.jussieu.fr (Postfix) with ESMTP id 5A8C52377F6; Wed, 26 Mar 2008 14:18:00 +0100 (CET) Received: by niobe.lpthe.jussieu.fr (Postfix, from userid 2005) id 4A08730; Wed, 26 Mar 2008 14:18:00 +0100 (CET) Date: Wed, 26 Mar 2008 14:18:00 +0100 From: Michel Talon To: freebsd-ports@FreeBSD.org Message-ID: <20080326131800.GA75243@lpthe.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (shiva.jussieu.fr [134.157.0.166]); Wed, 26 Mar 2008 14:18:03 +0100 (CET) X-Virus-Scanned: ClamAV 0.92/6396/Wed Mar 26 12:29:12 2008 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail.jussieu.fr with ID 47EA4D0A.003 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 47EA4D0A.003/134.157.10.1/parthe.lpthe.jussieu.fr/parthe.lpthe.jussieu.fr/ X-j-chkmail-Score: MSGID : 47EA4D0A.003 on jchkmail.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.044 -> S=0.044 X-j-chkmail-Status: Ham Cc: soralx@cydem.org Subject: Re: ports system woes X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2008 13:18:24 -0000 Pav Lucistnik wrote: > Quick solution would be to gather all depnames for the deleted package, > and then do a single pass over /var/db/pkg entries looking for origins. > > Ultimate solution would be to implement a database which would > concentrate origins for all packages with linear lookup time. In fact last year i wrote a python script which reads all the /var/db/pkg/+CONTENTS files, and fixes all the +REQUIRED_BY files, assuming they are corrupted. Moreover it follows the MOVED file. Optionnally it decomposes the set of ports in connected components, and builds graphviz graphs for the dependencies. Of course the leaf packages are written down. As far as i remember this program runs in a few *seconds* certainly not minutes like it is said here for the pkg_delete stuff. You can find it here: http://www.lpthe.jussieu.fr/~talon/pkg_check.py This being said, i agree with you, that for various reasons, the package system needs to get rid of the extremely bad idea of abusing the filesystem as a database, and use a true database for doing its job. This would allow O(1) searches, as you are saying, and would allow to perform appropriate locking for supporting parallel builds. We had this discussion last year, and i am even more convinced that the good solution is to use sqlite and not some half-assed solution like a Berkeley database, if only because using a sql database will lead naturally to a more structured solution, and not a pile of blobs, and also because sqlite is a stable software. More generally i disagree with Kris Kennaway idea that all is required is to polish the existing tools. They are so obviously broken from all points of view, particularly portupgrade, that only a complete rewrite can do any good. Needless to say, this cannot please those FreeBSD ports afficionados who are convinced that their toy is the best in the world. Let me recall that *one* person has completely rewritten the ports system for OpenBSD (Marc Espie), including the pkg* tools and all the Makefile scripts, and now it works. -- Michel TALON