diff options
author | rillig <rillig@pkgsrc.org> | 2020-04-23 19:16:49 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-04-23 19:16:49 +0000 |
commit | 40a7384d7102f519552e03320eb4c89cf0c11a07 (patch) | |
tree | b00320ff13294fa48dfdfc6bf2ebb9097d639b1f /mk | |
parent | 2684261941da494cfe6a260524da79427ce4e52a (diff) | |
download | pkgsrc-40a7384d7102f519552e03320eb4c89cf0c11a07.tar.gz |
mk/subst.mk: omit ./ for sanely named files, quote filename patterns
Diffstat (limited to 'mk')
-rw-r--r-- | mk/subst.mk | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mk/subst.mk b/mk/subst.mk index c7a1ce921ac..1b439f56ad4 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,4 +1,4 @@ -# $NetBSD: subst.mk,v 1.81 2020/04/23 19:06:09 rillig Exp $ +# $NetBSD: subst.mk,v 1.82 2020/04/23 19:16:49 rillig Exp $ # # The subst framework replaces text in one or more files in the WRKSRC # directory. Packages can define several ``classes'' of replacements. @@ -167,7 +167,7 @@ ${_SUBST_COOKIE.${class}}: set +f; \ changed=no; \ for file in $$pattern; do \ - case $$file in /*) ;; *) file="./$$file";; esac; \ + case $$file in ([!A-Za-z0-9/]*) file="./$$file";; esac; \ tmpfile="$$file.subst.sav"; \ [ -d "$$file" ] && continue; \ [ -f "$$file" ] || { \ @@ -180,7 +180,7 @@ ${_SUBST_COOKIE.${class}}: }; \ ${SUBST_FILTER_CMD.${class}} < "$$file" > "$$tmpfile"; \ ${CMP} -s "$$tmpfile" "$$file" && { \ - ${_SUBST_WARN.${class}} "Nothing changed in $$file."; \ + ${_SUBST_WARN.${class}} "Nothing changed in \"$$file\"."; \ ${RM} -f "$$tmpfile"; \ continue; \ }; \ |