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:           Tue Aug  4 21:46:44 UTC 2020

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

Log Message:
mk/help: fix help parser for variable names followed by comma

Seen in mk/fetch/fetch.mk for FETCH_USE_IPV4_ONLY.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 pkgsrc/mk/help/help.awk
cvs rdiff -u -r1.6 -r1.7 pkgsrc/regress/infra-unittests/help.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/help/help.awk
diff -u pkgsrc/mk/help/help.awk:1.41 pkgsrc/mk/help/help.awk:1.42
--- pkgsrc/mk/help/help.awk:1.41        Sun May  3 10:57:06 2020
+++ pkgsrc/mk/help/help.awk     Tue Aug  4 21:46:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.41 2020/05/03 10:57:06 rillig Exp $
+# $NetBSD: help.awk,v 1.42 2020/08/04 21:46:44 rillig Exp $
 #
 
 # This program extracts the inline documentation from *.mk files.
@@ -192,7 +192,7 @@ eval_this_line && NF >= 1 && !/^[\t.]/ &
                # want them anyway, list them in a "Keywords:" line.
                dprint_skip(w, "it is mixed case");
 
-       } else if (w !~ /^[A-Za-z][-0-9A-Z_a-z]*[0-9A-Za-z](:|\?=|=)?$/) {
+       } else if (w !~ /^[A-Za-z][-0-9A-Z_a-z]*[0-9A-Za-z]([,:]|\?=|=)?$/) {
                # Keywords must consist only of letters, digits, hyphens
                # and underscores; except for some trailing type specifier.
                dprint_skip(w, "it contains special characters");
@@ -212,12 +212,12 @@ eval_this_line && NF >= 1 && !/^[\t.]/ &
                # Upper-case words ending with a colon are probably not
                # make targets, so ignore them. Common cases are tags
                # like FIXME and TODO.
-               dprint_skip(w, "it is uppercase and followed by a hyphen");
+               dprint_skip(w, "it is uppercase and followed by a colon");
 
        } else {
                sub(/^#[ \t]*/, "", w);
                sub(/(:|\?=|=)$/, "", w);
-               sub(/:$/, "", w);
+               sub(/[,:]$/, "", w);
                if (w != "") {
                        if (debug) dprint("Adding keyword \"" w "\"");
                        keywords[w] = yes;

Index: pkgsrc/regress/infra-unittests/help.sh
diff -u pkgsrc/regress/infra-unittests/help.sh:1.6 pkgsrc/regress/infra-unittests/help.sh:1.7
--- pkgsrc/regress/infra-unittests/help.sh:1.6  Tue Aug  4 21:35:01 2020
+++ pkgsrc/regress/infra-unittests/help.sh      Tue Aug  4 21:46:44 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: help.sh,v 1.6 2020/08/04 21:35:01 rillig Exp $
+# $NetBSD: help.sh,v 1.7 2020/08/04 21:46:44 rillig Exp $
 #
 # Test cases for "bmake help", mainly implemented in mk/help/help.awk.
 #
@@ -157,9 +157,10 @@ if test_case_begin 'variable name follow
                'fetch.mk' >'out'
 
        assert_that 'out' --file-is-lines \
-               'No help found for fetch_use_ipv4_only, but it appears in:' \
-               '' \
-               'fetch.mk'
+               '===> fetch.mk (keywords: FETCH_USE_IPV4_ONLY):' \
+               '# FETCH_USE_IPV4_ONLY, if defined, will ...' \
+               '#      ...' \
+               '#      ...'
 
        test_case_end
 fi



Home | Main Index | Thread Index | Old Index