summaryrefslogtreecommitdiff
path: root/mk/install
diff options
context:
space:
mode:
authorrillig <rillig>2005-08-21 22:27:09 +0000
committerrillig <rillig>2005-08-21 22:27:09 +0000
commit0a0259d4990457a052a026f5231dcda2239bc55f (patch)
tree3e8c769e6833b5671ab3dfafbe1984519120a87c /mk/install
parent64e3b1fe8c105d2aa7d85841e0b9b63a35beff47 (diff)
downloadpkgsrc-0a0259d4990457a052a026f5231dcda2239bc55f.tar.gz
Simplified the strip_prefix function. Tested with /usr/bin/awk on Solaris,
nawk and gawk.
Diffstat (limited to 'mk/install')
-rw-r--r--mk/install/bsd.pkginstall.mk9
1 files changed, 4 insertions, 5 deletions
diff --git a/mk/install/bsd.pkginstall.mk b/mk/install/bsd.pkginstall.mk
index 58403e973b2..33039964c07 100644
--- a/mk/install/bsd.pkginstall.mk
+++ b/mk/install/bsd.pkginstall.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.13 2005/08/20 02:22:02 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.14 2005/08/21 22:27:09 rillig Exp $
#
# This Makefile fragment is included by bsd.pkg.mk to use the common
# INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply:
@@ -18,14 +18,13 @@ BSD_PKG_INSTALL_MK= 1
# stripping ${PREFIX}/ from a pathname.
_FUNC_STRIP_PREFIX= \
strip_prefix() { \
- { echo "$$1"; echo ${PREFIX:Q}/; } \
- | ${AWK} 'NR==1 { s=$$0 } NR==2 { prefix=$$0 } \
- END { plen = length(prefix); \
+ ${AWK} 'END { \
+ plen = length(prefix); \
if (substr(s, 1, plen) == prefix) { \
s = substr(s, 1 + plen, length(s) - plen); \
} \
print s; \
- }'; \
+ }' s="$$1" prefix="$$2" /dev/null; \
}
DEINSTALL_FILE= ${PKG_DB_TMPDIR}/+DEINSTALL