Sun Mar 22 21:31:21 2020 UTC ()
mk/configure/replace-interpreter.mk: add missing empty line

The optional /usr/bin/env is independent from sh. It applies to all
languages.


(rillig)
diff -r1.17 -r1.18 pkgsrc/mk/configure/replace-interpreter.mk

cvs diff -r1.17 -r1.18 pkgsrc/mk/configure/replace-interpreter.mk (expand / switch to unified diff)

--- pkgsrc/mk/configure/replace-interpreter.mk 2019/02/18 14:10:37 1.17
+++ pkgsrc/mk/configure/replace-interpreter.mk 2020/03/22 21:31:21 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: replace-interpreter.mk,v 1.17 2019/02/18 14:10:37 bsiegert Exp $ 1# $NetBSD: replace-interpreter.mk,v 1.18 2020/03/22 21:31:21 rillig Exp $
2 2
3# This file provides common templates for replacing #! interpreters 3# This file provides common templates for replacing #! interpreters
4# in script files. 4# in script files.
5# 5#
6# The following variables may be set by a package: 6# The following variables may be set by a package:
7# 7#
8# REPLACE_AWK 8# REPLACE_AWK
9# REPLACE_BASH 9# REPLACE_BASH
10# REPLACE_CSH 10# REPLACE_CSH
11# REPLACE_KSH 11# REPLACE_KSH
12# REPLACE_PERL 12# REPLACE_PERL
13# REPLACE_PERL6 13# REPLACE_PERL6
14# REPLACE_SH 14# REPLACE_SH
@@ -89,26 +89,27 @@ REPLACE_FILES.sys-Perl= ${REPLACE_PERL} @@ -89,26 +89,27 @@ REPLACE_FILES.sys-Perl= ${REPLACE_PERL}
89PERL6?= ${PREFIX}/bin/perl6 89PERL6?= ${PREFIX}/bin/perl6
90REPLACE_INTERPRETER+= sys-Perl6 90REPLACE_INTERPRETER+= sys-Perl6
91REPLACE.sys-Perl6.old= .*perl6[^[:space:]]* 91REPLACE.sys-Perl6.old= .*perl6[^[:space:]]*
92REPLACE.sys-Perl6.new= ${PERL6} 92REPLACE.sys-Perl6.new= ${PERL6}
93REPLACE_FILES.sys-Perl6=${REPLACE_PERL6} 93REPLACE_FILES.sys-Perl6=${REPLACE_PERL6}
94.endif 94.endif
95 95
96.if !empty(REPLACE_SH:M*) 96.if !empty(REPLACE_SH:M*)
97REPLACE_INTERPRETER+= sys-sh 97REPLACE_INTERPRETER+= sys-sh
98REPLACE.sys-sh.old= [^[:space:]]*sh 98REPLACE.sys-sh.old= [^[:space:]]*sh
99REPLACE.sys-sh.new= ${SH} 99REPLACE.sys-sh.new= ${SH}
100REPLACE_FILES.sys-sh= ${REPLACE_SH} 100REPLACE_FILES.sys-sh= ${REPLACE_SH}
101.endif 101.endif
 102
102# sed regexp to match optional "/usr/bin/env" followed by one or more spaces 103# sed regexp to match optional "/usr/bin/env" followed by one or more spaces
103REPLACE.optional-env-space= \(/usr/bin/env[[:space:]][[:space:]]*\)\{0,1\} 104REPLACE.optional-env-space= \(/usr/bin/env[[:space:]][[:space:]]*\)\{0,1\}
104 105
105.PHONY: replace-interpreter 106.PHONY: replace-interpreter
106replace-interpreter: 107replace-interpreter:
107.for _lang_ in ${REPLACE_INTERPRETER} 108.for _lang_ in ${REPLACE_INTERPRETER}
108. if defined(REPLACE_FILES.${_lang_}) && !empty(REPLACE_FILES.${_lang_}:M*) 109. if defined(REPLACE_FILES.${_lang_}) && !empty(REPLACE_FILES.${_lang_}:M*)
109 @${STEP_MSG} "Replacing ${_lang_:S/^sys-//} interpreter in "${REPLACE_FILES.${_lang_}:M*:Q}"." 110 @${STEP_MSG} "Replacing ${_lang_:S/^sys-//} interpreter in "${REPLACE_FILES.${_lang_}:M*:Q}"."
110 ${RUN} set -u; \ 111 ${RUN} set -u; \
111 cd ${WRKSRC}; \ 112 cd ${WRKSRC}; \
112 for f in ${REPLACE_FILES.${_lang_}}; do \ 113 for f in ${REPLACE_FILES.${_lang_}}; do \
113 if [ -f "$${f}" ]; then \ 114 if [ -f "$${f}" ]; then \
114 ${SED} -e '1s|^#![[:space:]]*${REPLACE.optional-env-space}${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ 115 ${SED} -e '1s|^#![[:space:]]*${REPLACE.optional-env-space}${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \