ports system woes

Michel Talon talon at lpthe.jussieu.fr
Wed Mar 26 06:18:24 PDT 2008


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



More information about the freebsd-ports mailing list