diff options
author | mspo <mspo@pkgsrc.org> | 2013-04-18 00:24:48 +0000 |
---|---|---|
committer | mspo <mspo@pkgsrc.org> | 2013-04-18 00:24:48 +0000 |
commit | 53b5e31988d00d1ec0da386233ea1359fb540920 (patch) | |
tree | 128ecf4003d1fe774a433ecd2c740b413ba21257 /mk/configure | |
parent | 0627ff9ffa080922ef703d2b00c9f6f571a3c638 (diff) | |
download | pkgsrc-53b5e31988d00d1ec0da386233ea1359fb540920.tar.gz |
use improved version from apb, works with parallel/paexec
Diffstat (limited to 'mk/configure')
-rw-r--r-- | mk/configure/replace-interpreter.mk | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mk/configure/replace-interpreter.mk b/mk/configure/replace-interpreter.mk index ffce4fbd1b0..0cff782e273 100644 --- a/mk/configure/replace-interpreter.mk +++ b/mk/configure/replace-interpreter.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace-interpreter.mk,v 1.12 2013/04/02 00:28:57 mspo Exp $ +# $NetBSD: replace-interpreter.mk,v 1.13 2013/04/18 00:24:48 mspo Exp $ # This file provides common templates for replacing #! interpreters # in script files. @@ -89,6 +89,8 @@ REPLACE.sys-sh.old= [^[:space:]]*sh REPLACE.sys-sh.new= ${SH} REPLACE_FILES.sys-sh= ${REPLACE_SH} .endif +# sed regexp to match optional "/usr/bin/env" followed by one or more spaces +REPLACE.optional-env-space= \(/usr/bin/env[[:space:]][[:space:]]*\)\{0,1\} .PHONY: replace-interpreter replace-interpreter: @@ -99,8 +101,7 @@ replace-interpreter: cd ${WRKSRC}; \ for f in ${REPLACE_FILES.${_lang_}}; do \ if [ -f "$${f}" ]; then \ - ${SED} -e '1{ /env -i/!s|^#![[:space:]]*/usr/bin/env|#!|;}' \ - -e '1s|^#![[:space:]]*${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ + ${SED} -e '1s|^#![[:space:]]*${REPLACE.optional-env-space}${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ < "$${f}" > "$${f}.new"; \ if [ -x "$${f}" ]; then \ ${CHMOD} a+x "$${f}.new"; \ |