diff options
author | adam <adam@pkgsrc.org> | 2018-04-17 09:31:41 +0000 |
---|---|---|
committer | adam <adam@pkgsrc.org> | 2018-04-17 09:31:41 +0000 |
commit | f714d3b825d263e735ea3d56a45d7cb13f9664e3 (patch) | |
tree | 8118339d20ef402aa2136c9e0deef67c3145e6d1 /mk | |
parent | 066199dd614bb7268c5f425b1171e1152f56a48b (diff) | |
download | pkgsrc-f714d3b825d263e735ea3d56a45d7cb13f9664e3.tar.gz |
Print a message if REPLACE_INTERPRETER does not change anything (similar to SUBST_)
Diffstat (limited to 'mk')
-rw-r--r-- | mk/configure/replace-interpreter.mk | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mk/configure/replace-interpreter.mk b/mk/configure/replace-interpreter.mk index aa7d2c50083..3991da5d4fd 100644 --- a/mk/configure/replace-interpreter.mk +++ b/mk/configure/replace-interpreter.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace-interpreter.mk,v 1.15 2018/03/11 15:07:45 rillig Exp $ +# $NetBSD: replace-interpreter.mk,v 1.16 2018/04/17 09:31:41 adam Exp $ # This file provides common templates for replacing #! interpreters # in script files. @@ -107,7 +107,12 @@ replace-interpreter: if [ -x "$${f}" ]; then \ ${CHMOD} a+x "$${f}.new"; \ fi; \ - ${MV} -f "$${f}.new" "$${f}"; \ + if ${CMP} -s "$${f}.new" "$${f}"; then \ + ${INFO_MSG} "[replace-interpreter] Nothing changed in $${f}."; \ + ${RM} -f "$${f}.new"; \ + else \ + ${MV} -f "$${f}.new" "$${f}"; \ + fi; \ elif [ -d "$$f" ]; then \ ${SHCOMMENT} "Ignore it, most probably comes from shell globs"; \ else \ |