diff options
author | rillig <rillig@pkgsrc.org> | 2020-05-03 09:44:07 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-05-03 09:44:07 +0000 |
commit | aac21bb29b3fbfb5d4623d2a746de4b70b99215d (patch) | |
tree | 040553954f5f4b44c93a24f0211c68846fa6d3a8 /mk | |
parent | b64c0c2c2394e8c305615dea65922683a265ccf4 (diff) | |
download | pkgsrc-aac21bb29b3fbfb5d4623d2a746de4b70b99215d.tar.gz |
mk/help: make variable more precise
The word "ignore" was too unspecific. There are lines that should be
printed, and there are lines that should be evaluated.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/help/help.awk | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mk/help/help.awk b/mk/help/help.awk index 0ac478d15f5..5fd1e1fcaa0 100644 --- a/mk/help/help.awk +++ b/mk/help/help.awk @@ -1,4 +1,4 @@ -# $NetBSD: help.awk,v 1.37 2020/05/03 09:06:59 rillig Exp $ +# $NetBSD: help.awk,v 1.38 2020/05/03 09:44:07 rillig Exp $ # # This program extracts the inline documentation from *.mk files. @@ -16,7 +16,7 @@ BEGIN { found_anything = no; # has some help text been found at all? last_fname = ""; - ignore_this_line = no; + print_this_line = yes; ignore_next_empty_line = no; ignore_this_section = no; @@ -127,14 +127,14 @@ function array_is_empty(arr, i, empty) { } { - ignore_this_line = (ignore_next_empty_line && $0 == "#") || $0 == ""; + print_this_line = $0 != "" && !(ignore_next_empty_line && $0 == "#"); ignore_next_empty_line = no; } # There is no need to print the RCS Id, since the full pathname # is prefixed to the file contents. /^#.*\$.*\$$/ { - ignore_this_line = yes; + print_this_line = no; ignore_next_empty_line = yes; } @@ -149,7 +149,7 @@ function array_is_empty(arr, i, empty) { keywords[w] = yes; dprint("Adding keyword \"" w "\""); } - ignore_this_line = yes; + print_this_line = no; ignore_next_empty_line = yes; } @@ -170,7 +170,7 @@ $1 ~ /:$/ && $2 == ".PHONY" { end_of_topic(); } -(!ignore_this_line) { +print_this_line { lines[nlines++] = $0; } |