diff options
author | jlam <jlam> | 2003-09-13 05:55:14 +0000 |
---|---|---|
committer | jlam <jlam> | 2003-09-13 05:55:14 +0000 |
commit | 67b67131a0937c03674d656e3a9803b63ae258b5 (patch) | |
tree | a4366ab3838a45ed1e136a5d00a1a9541bfd781a /mk/bsd.prefs.mk | |
parent | b8a50cecce5f0febbfea0fdbc7d9245f1176e466 (diff) | |
download | pkgsrc-67b67131a0937c03674d656e3a9803b63ae258b5.tar.gz |
In cases where we need the best match for a pkgpattern, use
"${PKG_BEST_EXIST} pkgpattern" instead of "${PKG_INFO} -e pkgpattern". The
latter can return multiple package names if there are multiple versions of
a piece of software installed. PKG_BEST_EXIST is defined to be
"${PKG_ADMIN} -b -d ${_PKG_DBDIR} -s "" lsbest", so it searches for the
best installed package that matches the given pkgpattern or else returns
the empty string.
Bump PKGTOOLS_REQD to 20030912 since pkg_admin(1) needs to know about "-b"
and "-d <dir>".
Diffstat (limited to 'mk/bsd.prefs.mk')
-rw-r--r-- | mk/bsd.prefs.mk | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 4278969cf0c..717a88e311d 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.124 2003/09/12 16:07:09 grant Exp $ +# $NetBSD: bsd.prefs.mk,v 1.125 2003/09/13 05:55:15 jlam Exp $ # # Make file, included to get the site preferences, if any. Should # only be included by package Makefiles before any .if defined() @@ -335,6 +335,13 @@ PKG_INFO?= ${PKG_INFO_CMD} ${PKGTOOLS_ARGS} PKG_VIEW?= ${PKG_VIEW_CMD} ${PKG_VIEW_ARGS} LINKFARM?= ${LINKFARM_CMD} +# "${PKG_BEST_EXISTS} pkgpattern" prints out the name of the installed +# package that best matches pkgpattern. Use this instead of +# "${PKG_INFO} -e pkgpattern" if the latter would return more than one +# package name. +# +PKG_BEST_EXISTS?= ${PKG_ADMIN} -b -d ${_PKG_DBDIR} -s "" lsbest + .ifndef PKGTOOLS_VERSION PKGTOOLS_VERSION!= ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302 MAKEFLAGS+= PKGTOOLS_VERSION="${PKGTOOLS_VERSION}" |