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 | ac86d6920bf13dd5b8841853322a44420946d8dc (patch) | |
tree | 128ecf4003d1fe774a433ecd2c740b413ba21257 /mk | |
parent | 68c9f1ffdb1fc9c7df24892f535c4a4bb569c924 (diff) | |
download | pkgsrc-ac86d6920bf13dd5b8841853322a44420946d8dc.tar.gz |
use improved version from apb, works with parallel/paexec
Diffstat (limited to 'mk')
-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"; \ |