portindex -- the second coming.

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Oct 23 02:22:18 PDT 2004


On Fri, Oct 22, 2004 at 06:18:41PM -0400, Christopher Nehren wrote:
> On Fri, 22 Oct 2004 17:38:54 +0100, Matthew Seaman wrote:
> 
> > Dear all,
> > 
> > After the recent fun and games with the sysutils/portindex port by
> > Radim Kolar, it seems there is a pent up demand for software that can
> > maintain /usr/ports/INDEX without the hassle of going through a full
> > 'make index' every time you want to update.
> > 
> > I've put together a few bits of perl to achieve that.  Now I'm looking
> > for people to try it out, send me feedback, bug reports, suggestions
> > etc.  To be beta testers in fact.
> 
> Yum. I also appreciate your choice of implementation language. :)
>  
> Although, actually, the main reason for why I liked portindex was that it
> made an extremely detailed entry of every single port in a PostgreSQL
> database. You could then make complex queries against that database using
> SQL. You could see which ports you had installed which depended upon a
> group of ports that matched a regex, for example (using subqueries --
> which is one of the reasons why I'm glad that PostgreSQL was chosen,
> instead of a certain overly popular RDBMS which shall remain nameless
> which lacks this feature). I don't know about others, but the SQL
> interface is much more intuitive for me than using make syntax. And it's
> more flexible, too. Not to mention that you can easily make graphs from
> it, and so forth ...
> 
> If you're interested, I'd like to implement the RDBMS side of your
> portindex replacement.
> 
> I'll take a look at your replacement later tonight, and shall give further
> feedback either then or tomorrow.

I have absolutely no objection to that, although what I wrote might
not be the best starting point.  I just dump what is essentially the
'make describe' output into the DB file as an opaque lump, and all of
the dependency accumulation is done in the front end portindex
process.  What you're describing implies doing quite a bit more
dissection of the data to fit it into a proper RDBMS schema, and
having done that, moving much of the processing required into the SQL
back end would only be sensible.

I'd be against making it a requirement to install a RDBMS back end in
order to use portindex though.  I'm half minded to make the dependency
on BerkeleyDB optional as well -- there's no reason why portindex
shouldn't work using the standard DB_File bundled with perl, and the
db1.86 code bundled with the system, so long as that annoying bug has
been patched.

I suspect that Dan Nelson, of freshports.org, probably has pretty much
exactly the code you're looking for (PostgreSQL back end and all),
although I have no idea if he would be prepared to release any of it.

I also noticed this morning that there's already a FreeBSD::Ports
module in the tree (by Tom Hukins) so I may have to do a bit of
renaming.  Plus I'll be putting out an update shortly so that it deals
more gracefully with various ports breakages, like:

    % sudo ./portindex -o /usr/ports/INDEX
    Accumulating dependency information: .........[1000].........[2000]........FreeBSD::Port::accumulate_dependencies: ja-sdic-2.1.2 claims to have a dependency on /usr/ports/japanese/edict-sdic, but no such port is known at FreeBSD/Ports/Tree.pm line 395
    Can't call method "RUN_DEPENDS" on an undefined value at FreeBSD/Port.pm line 201.

and:

    % echo /usr/ports/japanese/sdic | ./cache-update -f plain
    cache-update:1: Updating cached data for /usr/ports/japanese/sdic
    ja-sdic-2.1.2: "/usr/ports/japanese/edict-sdic" non-existent -- dependency list incomplete
    FreeBSD::Ports::Tree::make_describe():/usr/ports/japanese/sdic: make: bad exit status -- 256 at ./cache-update line 246
    FreeBSD::Ports::Tree::make_describe():/usr/ports/japanese/sdic -- deleted from cache at ./cache-update line 246

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20041023/68742591/attachment.bin


More information about the freebsd-ports mailing list