Doing SQL to the FreeBSD ports index

Matthew Seaman m.seaman at
Sun Jan 29 11:54:10 UTC 2012

On 28/01/2012 02:05, rflynn at wrote:
> I haven't looked in detail - perl has to leave my head - but what I think
> is a good feature for a database to handle is to find outdated distfiles.
> Since the relationship between a portorigin and it's distfile(s) is not
> available otherwise. I realize portmaster uses /var/db/ports for it, yet
> if you share $PORTSDIR but not $PORT_DBDIR (different machines, different
> requirements) then this method gets ugly fast. Quick parse of distinfo
> should do the trick. Record the hash and you can get bonus points for
> indicating hash errors (incomplete aborted downloads or upstream changed
> distfile).

I've just added tables to handle distinfo data to portindexdb.  Get
release 972 from while it's
hot.  And thank you very much for the suggestion.

Now for the weasely-worded bit.  portindexdb takes a snapshot of the
current state of the ports tree, so finding outdated or broken distfiles
is a matter of calculating the checksums of the files you find in
/usr/ports/distfiles and picking out the ones where the checksum is
unknown in the database.  (Actually scripting up this is left as an
exercise for the student.)

*Except* some ports use alternate distinfo files depending on the
current system architecture, so beware: this method may flag up some
good distfiles if you share your ${PORTSDIR} between machines of
different architectures.  It's relatively few things and mostly stuff
like pre-compiled Linux binaries that are affected.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID: matthew at               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-ports mailing list