summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2005-11-28 05:54:17 +0000
committerjlam <jlam>2005-11-28 05:54:17 +0000
commitae092cf4688f867877cef32e5e4f2926c6340385 (patch)
treee49cb7dcca4efdda04325e31d4ca4fb08ba3c962
parent2d81a61d995c010abb21a64a8cd8375d27373a96 (diff)
downloadpkgsrc-ae092cf4688f867877cef32e5e4f2926c6340385.tar.gz
Extend find-prefix.mk so that we can specify a package wildcard instead
of just ${PKGBASE}, e.g. M4DIR=m4>=1.0 will set M4DIR to the installation prefix of m4 if it matches "m4>=1.0", otherwise it will set M4DIR to ${M4DIR_DEFAULT}.
-rw-r--r--mk/find-prefix.mk10
1 files changed, 5 insertions, 5 deletions
diff --git a/mk/find-prefix.mk b/mk/find-prefix.mk
index dfc47fd4afc..135cbd5827f 100644
--- a/mk/find-prefix.mk
+++ b/mk/find-prefix.mk
@@ -1,12 +1,12 @@
-# $NetBSD: find-prefix.mk,v 1.3 2005/05/13 23:37:54 jlam Exp $
+# $NetBSD: find-prefix.mk,v 1.4 2005/11/28 05:54:17 jlam Exp $
#
# This is a "subroutine" that can be included to find the installation
# prefix of a package.
#
-# The input variable is FIND_PREFIX, which is a list of VARNAME=<package>
+# The input variable is FIND_PREFIX, which is a list of VARNAME=<pattern>
# pairs, where "VARNAME" is the variable that will be set to the
-# installation prefix for the package, and <package> is the ${PKGNAME}
-# for the package.
+# installation prefix for the package, and <pattern> is a package
+# wildcard pattern used to match the installed package (see pkg_info(8)).
#
# An example use is:
#
@@ -19,7 +19,7 @@
. if !defined(${_def_:C/=.*$//})
${_def_:C/=.*$//}_DEFAULT?= ${LOCALBASE}
_${_def_:C/=.*$//}_cmd= \
- ${PKG_INFO} -qp ${_def_:C/^.*=//} 2>/dev/null | \
+ ${PKG_INFO} -qp ${_def_:C/^[^=]*=//:Q} 2>/dev/null | \
{ read cmd arg; \
case "$$arg" in \
"") ${ECHO} ${${_def_:C/=.*$//}_DEFAULT:Q} ;; \