From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 30 22:08:09 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4C611065690; Thu, 30 Apr 2009 22:08:09 +0000 (UTC) (envelope-from reg@openpave.org) Received: from mx1.ucdavis.edu (mx1.ucdavis.edu [128.120.32.31]) by mx1.freebsd.org (Postfix) with ESMTP id 87E1B8FC1D; Thu, 30 Apr 2009 22:08:09 +0000 (UTC) (envelope-from reg@openpave.org) Received: from flint.openpave.org ([169.237.230.40]) by mx1.ucdavis.edu (8.13.7/8.13.1/it-defang-5.4.0) with ESMTP id n3ULjKIx018760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 30 Apr 2009 14:45:20 -0700 (PDT) Received: from sandy.local (flint.local [192.168.1.5]) by flint.openpave.org (8.14.3/8.14.3) with ESMTP id n3ULjKvC038337; Thu, 30 Apr 2009 21:45:20 GMT (envelope-from reg@sandy.local) Received: (from reg@localhost) by sandy.local (8.14.3/8.14.3/Submit) id n3ULjKxu038336; Thu, 30 Apr 2009 14:45:20 -0700 (PDT) (envelope-from reg) Date: Thu, 30 Apr 2009 14:45:20 -0700 From: Jeremy Lea To: David Forsythe Message-ID: <20090430214520.GA37974@flint.openpave.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on av3 X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.57 on 128.120.32.31 Cc: freebsd-hackers@FreeBSD.ORG, kientzle@FreeBSD.ORG Subject: Re: SoC2009: libpkg, pkg tools rewrite X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2009 22:08:10 -0000 Hi, On Sat, Apr 25, 2009 at 03:20:59PM -0400, David Forsythe wrote: > This summer I'll be working on creating a package library and using > that library to rewrite the pkg tools. A package library has been > discussed and even started before, but FreeBSD still does not have > one. This summer I'd like to get enough of the library done to atle > ast have a new set of pkg tools completed with the current features, > but ideally I'd like to get far enough to splice in some of the ideas > I have for new features. Since I've already done most of the work on this already, please, please, please, don't ignore what I have done. I know that it is not perfect, and that it is now five plus years out of date. But I have covered half of the bullet points on your to-do list already. The code is at http://sourceforge.net/projects/fpkg and some README stuff is at http://fpkg.sourceforge.net/ Some things which I think are critical: 1. The library needs a global "package manager". This needs to perform all of the tasks, and it should ideally do this through a task queue (which I didn't implement). See the lib/lib.h header in FreePKG. 2. The package manager must be able to separate out a structure of variables which can be determined without opening the +CONTENTS file. This must also include a package state, and the package manager must move these package headers from state to state. 3. There needs to be proper depends handling in the packages, so that we can maintain the correct dependency graph. This is vital for upgrading. This means adding @libdep and @filedep types to the package file. 4. bsd.port.mk should do everything through the tools. It should have no knowledge of the contents of /var/db/pkg. These are all done, to some degree in the code. The mistakes I made: 1. I made the file->pkg database to sensitive. If there is a miss it rebuilds the database for scratch - it should do a search through the +CONTENTS files and only rebuild it if there was a hit (meaning the database was wrong). 2. There needs to be a pkgname and origin database, which can be loaded at startup to prime the package manager. The dependency graph should also be stored in a database. These should be rebuilt if any directory in /var/db/pkg has a mtime later than the database (so could the file database). 3. There needs to be a set of flags which indicate how a package got installed (as a dependency or by the user), and if it has been upgraded in-place and might have old leftover libraries. These could go in +CONTENTS. In addition I also began the design of a new on disk package format. This was back when there was a group called openpackages which was trying to standardize ports/packages between the BSDs. In particular it has some ideas on package signing, which is an often requested feature. http://people.freebsd.org/~reg/opdesign.html Regards, -Jeremy -- FreeBSD - Because the best things in life are free... http://www.freebsd.org/