pkgsrc-Changes archive

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

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sat Apr 18 12:59:43 UTC 2020

Modified Files:
        pkgsrc/mk: subst.mk
        pkgsrc/regress/infra-unittests: subst.sh

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


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 pkgsrc/mk/subst.mk
cvs rdiff -u -r1.16 -r1.17 pkgsrc/regress/infra-unittests/subst.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/subst.mk
diff -u pkgsrc/mk/subst.mk:1.77 pkgsrc/mk/subst.mk:1.78
--- pkgsrc/mk/subst.mk:1.77     Sat Apr 18 12:21:10 2020
+++ pkgsrc/mk/subst.mk  Sat Apr 18 12:59:43 2020
@@ -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 @@ ${_SUBST_COOKIE.${class}}:
        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"

Index: pkgsrc/regress/infra-unittests/subst.sh
diff -u pkgsrc/regress/infra-unittests/subst.sh:1.16 pkgsrc/regress/infra-unittests/subst.sh:1.17
--- pkgsrc/regress/infra-unittests/subst.sh:1.16        Sat Apr 18 12:21:10 2020
+++ pkgsrc/regress/infra-unittests/subst.sh     Sat Apr 18 12:59:42 2020
@@ -223,7 +223,7 @@ EOF
        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 @@ EOF
        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 @@ if test_case_begin "pattern matches only
 
        # 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 @@ if test_case_begin "pattern matches only
        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 @@ if test_case_begin "first filename patte
        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