diff options
author | mspo <mspo@pkgsrc.org> | 2013-04-02 00:28:57 +0000 |
---|---|---|
committer | mspo <mspo@pkgsrc.org> | 2013-04-02 00:28:57 +0000 |
commit | 15d164d818ce4af53feaa1cd6414810ff7b32e49 (patch) | |
tree | b7489a9f48fcf58f667d0dc719e02a8b0cd11d2c /mk | |
parent | 16b0e92089bfb96c9ece79b15112d1ed061840d4 (diff) | |
download | pkgsrc-15d164d818ce4af53feaa1cd6414810ff7b32e49.tar.gz |
add some tricks to handle #!/usr/bin/env, do please improve
Diffstat (limited to 'mk')
-rw-r--r-- | mk/configure/replace-interpreter.mk | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mk/configure/replace-interpreter.mk b/mk/configure/replace-interpreter.mk index 95316dbd3b8..ffce4fbd1b0 100644 --- a/mk/configure/replace-interpreter.mk +++ b/mk/configure/replace-interpreter.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace-interpreter.mk,v 1.11 2012/02/06 06:18:36 sbd Exp $ +# $NetBSD: replace-interpreter.mk,v 1.12 2013/04/02 00:28:57 mspo Exp $ # This file provides common templates for replacing #! interpreters # in script files. @@ -99,7 +99,8 @@ replace-interpreter: cd ${WRKSRC}; \ for f in ${REPLACE_FILES.${_lang_}}; do \ if [ -f "$${f}" ]; then \ - ${SED} -e '1s|^#![[:space:]]*${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ + ${SED} -e '1{ /env -i/!s|^#![[:space:]]*/usr/bin/env|#!|;}' \ + -e '1s|^#![[:space:]]*${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ < "$${f}" > "$${f}.new"; \ if [ -x "$${f}" ]; then \ ${CHMOD} a+x "$${f}.new"; \ |