pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/help



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun May  3 10:51:06 UTC 2020

Modified Files:
        pkgsrc/mk/help: help.awk

Log Message:
mk/help: remove negation from variable names


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 pkgsrc/mk/help/help.awk

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.39 pkgsrc/mk/help/help.awk:1.40
--- pkgsrc/mk/help/help.awk:1.39        Sun May  3 09:51:07 2020
+++ pkgsrc/mk/help/help.awk     Sun May  3 10:51:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.39 2020/05/03 09:51:07 rillig Exp $
+# $NetBSD: help.awk,v 1.40 2020/05/03 10:51:06 rillig Exp $
 #
 
 # This program extracts the inline documentation from *.mk files.
@@ -18,8 +18,8 @@ BEGIN {
        last_fname = "";
        eval_this_line = yes;
        print_this_line = yes;
-       ignore_next_empty_line = no;
-       ignore_this_section = no;
+       eval_next_empty_line = yes;
+       print_this_section = yes;
 
        delete lines;           # the collected lines
        nlines = 0;             # the number of lines collected so far
@@ -43,7 +43,7 @@ function end_of_topic(   relevant, has_k
                ? "Ignoring section because of missing keywords." \
                : comment_lines <= 2 \
                ? "Ignoring section because of too small comment." \
-               : ignore_this_section \
+               : !print_this_section \
                ? "Ignoring section because of a previous decision." \
                : "";
 
@@ -99,13 +99,13 @@ function sorted_keys(array, prefix,   el
 }
 
 function cleanup() {
-       ignore_next_empty_line = yes;
+       eval_next_empty_line = no;
        delete lines;
        nlines = 0;
        delete keywords;
        comment_lines = 0;
        print_noncomment_lines = yes;
-       ignore_this_section = no;
+       print_this_section = yes;
 }
 
 function dprint(msg) {
@@ -128,22 +128,22 @@ function array_is_empty(arr,   i, empty)
 }
 
 {
-       print_this_line = $0 != "" && !(ignore_next_empty_line && $0 == "#");
-       ignore_next_empty_line = no;
+       print_this_line = $0 != "" && !(!eval_next_empty_line && $0 == "#");
+       eval_next_empty_line = yes;
 }
 
 # There is no need to print the RCS Id, since the full pathname
 # is prefixed to the file contents.
 /^#.*\$.*\$$/ {
        print_this_line = no;
-       ignore_next_empty_line = yes;
+       eval_next_empty_line = no;
 }
 
 # The lines containing the keywords should also not appear in
 # the output for now. This decision is not final since it may
 # be helpful for the user to know by which keywords a topic
 # can be reached.
-($1 == "#" && $2 == "Keywords:") {
+$1 == "#" && $2 == "Keywords:" {
        for (i = 3; i <= NF; i++) {
                w = ($i == toupper($i)) ? tolower($i) : $i;
                sub(/,$/, "", w);
@@ -151,16 +151,16 @@ function array_is_empty(arr,   i, empty)
                dprint("Adding keyword \"" w "\"");
        }
        print_this_line = no;
-       ignore_next_empty_line = yes;
+       eval_next_empty_line = no;
 }
 
-($0 == "#") {
-       ignore_next_empty_line = no;
+$0 == "#" {
+       eval_next_empty_line = yes;
 }
 
 $1 == "#" && $2 == "Copyright" {
        dprint("Ignoring the section because it contains \"Copyright\".");
-       ignore_this_section = yes;
+       print_this_section = no;
 }
 
 # Don't show the user the definition of make targets, since they are



Home | Main Index | Thread Index | Old Index