Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk mk/subst.mk: fix local variable names
details: https://anonhg.NetBSD.org/pkgsrc/rev/1c9f7db2efdf
branches: trunk
changeset: 434141:1c9f7db2efdf
user: rillig <rillig%pkgsrc.org@localhost>
date: Thu Jun 11 19:27:56 2020 +0000
description:
mk/subst.mk: fix local variable names
These variables don't record whether a file is changed but instead
whether a pattern was found.
diffstat:
mk/subst.mk | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (49 lines):
diff -r 2765973e0fa3 -r 1c9f7db2efdf mk/subst.mk
--- a/mk/subst.mk Thu Jun 11 18:04:41 2020 +0000
+++ b/mk/subst.mk Thu Jun 11 19:27:56 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: subst.mk,v 1.96 2020/06/11 18:04:41 rillig Exp $
+# $NetBSD: subst.mk,v 1.97 2020/06/11 19:27:56 rillig Exp $
#
# The subst framework replaces text in one or more files in the WRKSRC
# directory. Packages can define several ``classes'' of replacements.
@@ -187,7 +187,7 @@
noop_sep=''; \
for pattern in $$patterns; do \
set +f; \
- changed=no; \
+ found_any=no; \
for file in $$pattern; do \
case $$file in ([!A-Za-z0-9/]*) file="./$$file";; esac; \
tmpfile="$$file.subst.sav"; \
@@ -200,24 +200,24 @@
${_SUBST_WARN.${class}} "Ignoring non-text file \"$$file\"."; \
continue; \
}; \
- ${SUBST_FILTER_CMD.${class}} < "$$file" > "$$tmpfile"; \
+ ${SUBST_FILTER_CMD.${class}} < "$$file" > "$$tmpfile"; \
${CMP} -s "$$tmpfile" "$$file" && { \
${AWK} -f ${PKGSRCDIR}/mk/scripts/subst-identity.awk -- ${SUBST_SED.${class}} \
- && found=$$(LC_ALL=C ${SED} -n ${SUBST_SED.${class}:C,^['"]?s.*,&p,} "$$file") \
- && [ -n "$$found" ] \
- && changed=yes \
+ && found_text=$$(LC_ALL=C ${SED} -n ${SUBST_SED.${class}:C,^['"]?s.*,&p,} "$$file") \
+ && [ -n "$$found_text" ] \
+ && found_any=yes \
|| ${_SUBST_WARN.${class}} "Nothing changed in \"$$file\"."; \
${RM} -f "$$tmpfile"; \
continue; \
}; \
[ -x "$$file" ] && ${CHMOD} +x "$$tmpfile"; \
- changed=yes; \
+ found_any=yes; \
${_SUBST_KEEP.${class}}; \
${MV} -f "$$tmpfile" "$$file"; \
${ECHO} "$$file" >> ${.TARGET}.tmp; \
done; \
\
- [ "$$changed,${SUBST_NOOP_OK.${class}:tl}" = no,no ] && { \
+ [ "$$found_any,${SUBST_NOOP_OK.${class}:tl}" = no,no ] && { \
noop_count="$$noop_count+"; \
noop_patterns="$$noop_patterns$$noop_sep$$pattern"; \
noop_sep=" "; \
Home |
Main Index |
Thread Index |
Old Index