On Mon, Oct 20, 2003 at 11:16:04AM +0200, Erik Trulsson wrote:
> On Mon, Oct 20, 2003 at 08:39:37AM +0100, Matthew Seaman wrote:

> > That's not entirely true.  pkg_version(1) won't work without an INDEX
> > file.

> Yes, it will.  pkg_version will first check against the version of the
> port in the ports tree.  Only if that is not available is INDEX
> consulted.  Read the manpage for pkg_version(1) if you don't believe
> me.

You are entirely correct, except in the niggling pedantic sense that
the script will always try and read some sort of INDEX file into
itself.  Since the return value of the open() on the INDEX file is
never checked, it seems that you can just manage without.

pkg_version(1) always checks against the ports tree first, and then
reads the INDEX file to fill in any gaps.  That information was
cunningly hidden in the man page right above the paragraph I read, and
similarly in the script itself.  While you do have to provide an INDEX
file to keep it placated, I guess you could just use an empty file.
You lose out occasionally for ports that get deleted or renamed so
that the package origin no londer exists, but that's pretty uncommon.

About the only thing that /usr/ports/INDEX gets you which you can't
easily get by other means is the ability to do the package updates in
the correct order.  However there isn't an application in the base
system that can make use of that information.

        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

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to