summaryrefslogtreecommitdiff
path: root/mk/wrapper
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-11-28 12:57:46 +0000
committerrillig <rillig@pkgsrc.org>2007-11-28 12:57:46 +0000
commitba3e0729b2981acb9c1b2dd5d760528551d99e56 (patch)
tree9bc18a3b09b255ec746f2512f89ea226b4f66f37 /mk/wrapper
parent14985faa553ce505c36329fb2d1927163523c967 (diff)
downloadpkgsrc-ba3e0729b2981acb9c1b2dd5d760528551d99e56.tar.gz
Using a single awk process instead of a pipe of four grep processes
should be both faster and easier to read.
Diffstat (limited to 'mk/wrapper')
-rw-r--r--mk/wrapper/bsd.wrapper.mk10
1 files changed, 6 insertions, 4 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index 7e4b7ab3eac..7146ba8fce2 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.72 2007/09/20 18:17:18 rillig Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.73 2007/11/28 12:57:46 rillig Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -361,9 +361,11 @@ _WRAP_CACHE_BODY.IMAKE= ${WRAPPER_TMPDIR}/cache-body-solaris-imake
.endif
# Filter to scrunch shell scripts by removing comments and empty lines.
-_WRAP_SH_CRUNCH_FILTER= \
- ${GREP} -v "^\#[^!]" | ${GREP} -v "^[ ][ ]*\#" | \
- ${GREP} -v "^\#$$" | ${GREP} -v "^[ ]*$$"
+_WRAP_SH_CRUNCH_FILTER= ${AWK} ' \
+ /^\#!/ { print } \
+ /^[[:space:]]*\#/ || NF == 0 { next } \
+ /.*/ { print } \
+ ' | tee /dev/tty
_WRAP_SUBST_SED= \
-e "s|@ABI@|${ABI:Q}|g" \