Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 14:45:20 -0700
From:      Jeremy Lea <reg@FreeBSD.ORG>
To:        David Forsythe <dforsyth@FreeBSD.ORG>
Cc:        freebsd-hackers@FreeBSD.ORG, kientzle@FreeBSD.ORG
Subject:   Re: SoC2009: libpkg, pkg tools rewrite
Message-ID:  <20090430214520.GA37974@flint.openpave.org>
In-Reply-To: <dfaab3f70904251220yf5ba87aqafc300b44a06dc7e@mail.gmail.com>
References:  <dfaab3f70904251220yf5ba87aqafc300b44a06dc7e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



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