pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/wrapper Using a single awk process instead of a pip...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b24be833308c
branches:  trunk
changeset: 535769:b24be833308c
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Nov 28 12:57:46 2007 +0000

description:
Using a single awk process instead of a pipe of four grep processes
should be both faster and easier to read.

diffstat:

 mk/wrapper/bsd.wrapper.mk |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (24 lines):

diff -r 4a6531a7954b -r b24be833308c mk/wrapper/bsd.wrapper.mk
--- a/mk/wrapper/bsd.wrapper.mk Wed Nov 28 11:50:05 2007 +0000
+++ b/mk/wrapper/bsd.wrapper.mk Wed Nov 28 12:57:46 2007 +0000
@@ -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 @@
 .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"                                         \



Home | Main Index | Thread Index | Old Index