Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Feb 2014 07:30:38 +1100
From:      John Marshall <john.marshall@riverwillow.com.au>
To:        freebsd-ports@freebsd.org
Subject:   'pkg version -I index' ignores index argument
Message-ID:  <20140213203038.GA30069@rwpc15.gfn.riverwillow.net.au>

next in thread | raw e-mail | index | archive | help

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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."

--=20
John Marshall

--qMm9M+Fa2AknHoGS
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iEYEARECAAYFAlL9K24ACgkQw/tAaKKahKJysgCeMuy2cAtxSXUe/uLzZTXVQgAd
fEQAnAo3Z/jNDu24+DIyJFbPy/oHVF9K
=ChJd
-----END PGP SIGNATURE-----

--qMm9M+Fa2AknHoGS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140213203038.GA30069>