'pkg version -I index' ignores index argument

John Marshall john.marshall at riverwillow.com.au
Thu Feb 13 20:30:45 UTC 2014


Prompted by the recent EOL announcement and the very loud pkg_install
warning, I recently migrated about a dozen systems to pkgng.  So far the
only thing I've tripped over is the pkg-version(8) tool ignoring its
index argument.  The tool appears to do a good job of maintaining
backwards compatibility with its venerable predecessor:

usage: pkg_version [-hIoqv] [-l limchar] [-L limchar] [[-X] -s string]
                   [-O origin] [index]
       pkg_version -t v1 v2
       pkg_version -T name pattern

Usage: pkg version [-IPR] [-hoqvU] [-l limchar] [-L limchar] [-egix pattern]
                   [-r reponame] [-O origin] [index]
       pkg version -t <version1> <version2>
       pkg version -T <pkgname> <pattern>

but the new tool completely ignores its optional [index] argument and,
if I request use of an INDEX via -I, it will only work if there is an
INDEX file in the ports tree directory.  A missing ports tree directory
is also a fatal error.

I have submitted a PR (ports/186671) in which I provide a patch to
pkg/version.c to rectify this problem.  The patch:

 - removes the requirement for /usr/ports when using an index (-I)

 - reads and uses the optional index file argument which, if present,
   will supersede the default file in /usr/ports.

I am not a programmer, so please excuse and correct anything which is
done improperly.  "It works for me."

-- 
John Marshall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20140214/861be11d/attachment.sig>


More information about the freebsd-ports mailing list