summaryrefslogtreecommitdiff
path: root/mk/find-prefix.mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-05-13 23:37:54 +0000
committerjlam <jlam>2005-05-13 23:37:54 +0000
commita7861c7bef3521a3729e0fb79dfa12af539abb9e (patch)
tree4b5e60465af6622b6a5f5e34bf3c4dcab599c540 /mk/find-prefix.mk
parent482104733e1f979e91d214d9cdddf777e2ed5acd (diff)
downloadpkgsrc-a7861c7bef3521a3729e0fb79dfa12af539abb9e.tar.gz
Rewrite command to compute the installation prefix of a package to not
use awk -- a simple shell statement list suffices.
Diffstat (limited to 'mk/find-prefix.mk')
-rw-r--r--mk/find-prefix.mk9
1 files changed, 6 insertions, 3 deletions
diff --git a/mk/find-prefix.mk b/mk/find-prefix.mk
index 6990fcfe137..dfc47fd4afc 100644
--- a/mk/find-prefix.mk
+++ b/mk/find-prefix.mk
@@ -1,4 +1,4 @@
-# $NetBSD: find-prefix.mk,v 1.2 2005/05/12 21:56:11 jlam Exp $
+# $NetBSD: find-prefix.mk,v 1.3 2005/05/13 23:37:54 jlam Exp $
#
# This is a "subroutine" that can be included to find the installation
# prefix of a package.
@@ -20,8 +20,11 @@
${_def_:C/=.*$//}_DEFAULT?= ${LOCALBASE}
_${_def_:C/=.*$//}_cmd= \
${PKG_INFO} -qp ${_def_:C/^.*=//} 2>/dev/null | \
- ${AWK} '{ print $$2; exit }' | ${GREP} . || \
- ${ECHO} ${${_def_:C/=.*$//}_DEFAULT:Q}
+ { read cmd arg; \
+ case "$$arg" in \
+ "") ${ECHO} ${${_def_:C/=.*$//}_DEFAULT:Q} ;; \
+ *) ${ECHO} "$$arg" ;; \
+ esac; }
${_def_:C/=.*$//}= ${_${_def_:C/=.*$//}_cmd:sh}
. endif
MAKEVARS+= ${_def_:C/=.*$//}