pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc mk/subst.mk: make error message for filename pattern e...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2e44cbb875dd
branches:  trunk
changeset: 427613:2e44cbb875dd
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Apr 18 12:59:42 2020 +0000

description:
mk/subst.mk: make error message for filename pattern easier readable

diffstat:

 mk/subst.mk                      |   4 ++--
 regress/infra-unittests/subst.sh |  12 ++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)

diffs (68 lines):

diff -r 3eef631173f6 -r 2e44cbb875dd mk/subst.mk
--- a/mk/subst.mk       Sat Apr 18 12:54:38 2020 +0000
+++ b/mk/subst.mk       Sat Apr 18 12:59:42 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: subst.mk,v 1.77 2020/04/18 12:21:10 rillig Exp $
+# $NetBSD: subst.mk,v 1.78 2020/04/18 12:59:43 rillig Exp $
 #
 # The subst framework replaces text in one or more files in the WRKSRC
 # directory. Packages can define several ``classes'' of replacements.
@@ -193,7 +193,7 @@
        done;                                                           \
        \
        if ${TEST} "$$changed,${SUBST_NOOP_OK.${class}:tl}" = no,no; then \
-               ${FAIL_MSG} "[subst.mk:${class}] The pattern $$pattern has no effect."; \
+               ${FAIL_MSG} "[subst.mk:${class}] The filename pattern \"$$pattern\" has no effect."; \
        fi; \
        done; \
        cd ${WRKDIR}; ${RMDIR} "$$emptydir"
diff -r 3eef631173f6 -r 2e44cbb875dd regress/infra-unittests/subst.sh
--- a/regress/infra-unittests/subst.sh  Sat Apr 18 12:54:38 2020 +0000
+++ b/regress/infra-unittests/subst.sh  Sat Apr 18 12:59:42 2020 +0000
@@ -223,7 +223,7 @@
        create_file_lines "expected-output" \
                '=> Substituting "class" in single' \
                'warning: [subst.mk:class] Nothing changed in ./single.' \
-               'fail: [subst.mk:class] The pattern single has no effect.' \
+               'fail: [subst.mk:class] The filename pattern "single" has no effect.' \
                '*** Error code 1' \
                '' \
                'Stop.' \
@@ -256,7 +256,7 @@
        create_file_lines "expected-output" \
                '=> Substituting "class" in nonexistent' \
                'warning: [subst.mk:class] Ignoring non-existent file "./nonexistent".' \
-               'fail: [subst.mk:class] The pattern nonexistent has no effect.' \
+               'fail: [subst.mk:class] The filename pattern "nonexistent" has no effect.' \
                '*** Error code 1' \
                '' \
                'Stop.' \
@@ -884,10 +884,6 @@
 
        # When a pattern matches a directory, that directory is silently
        # skipped.
-       #
-       # In this test case, the pattern also matches a regular file that
-       # is actually modified. Therefore the pattern has an effect, and
-       # there is no error message.
 
        create_file_lines "testcase.mk" \
                'SUBST_CLASSES+=        dir' \
@@ -912,7 +908,7 @@
        assert_that "subdir/subfile" --file-is-lines "@VAR@" # unchanged
        assert_that "stdout" --file-is-lines \
                "=> Substituting \"dir\" in sub*" \
-               "fail: [subst.mk:dir] The pattern sub* has no effect." \
+               'fail: [subst.mk:dir] The filename pattern "sub*" has no effect.' \
                "*** Error code 1" \
                "" \
                "Stop." \
@@ -949,7 +945,7 @@
        assert_that "out" --file-is-lines \
                '=> Substituting "id" in file1 file2' \
                'warning: [subst.mk:id] Nothing changed in ./file1.' \
-               'fail: [subst.mk:id] The pattern file1 has no effect.' \
+               'fail: [subst.mk:id] The filename pattern "file1" has no effect.' \
                '*** Error code 1' \
                '' \
                'Stop.' \



Home | Main Index | Thread Index | Old Index