summaryrefslogtreecommitdiff
path: root/mk/help
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-05-03 09:51:07 +0000
committerrillig <rillig@pkgsrc.org>2020-05-03 09:51:07 +0000
commitad526e87eb33848edaec3d8ff251879c1251c7bd (patch)
treebd6e3bef1a56900a033e7435c3330f5a1db9edbd /mk/help
parentaac21bb29b3fbfb5d4623d2a746de4b70b99215d (diff)
downloadpkgsrc-ad526e87eb33848edaec3d8ff251879c1251c7bd.tar.gz
mk/help: do not treat continuation lines as textual comments
Diffstat (limited to 'mk/help')
-rw-r--r--mk/help/help.awk8
1 files changed, 5 insertions, 3 deletions
diff --git a/mk/help/help.awk b/mk/help/help.awk
index 5fd1e1fcaa0..49c9d1e1d3a 100644
--- a/mk/help/help.awk
+++ b/mk/help/help.awk
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.38 2020/05/03 09:44:07 rillig Exp $
+# $NetBSD: help.awk,v 1.39 2020/05/03 09:51:07 rillig Exp $
#
# This program extracts the inline documentation from *.mk files.
@@ -16,6 +16,7 @@ BEGIN {
found_anything = no; # has some help text been found at all?
last_fname = "";
+ eval_this_line = yes;
print_this_line = yes;
ignore_next_empty_line = no;
ignore_this_section = no;
@@ -178,7 +179,7 @@ print_this_line {
# be all-lowercase (make targets) or all-uppercase (variable names).
# Everything else is assumed to belong to the explaining text.
#
-NF >= 1 && !/^[\t.]/ && !/^#*$/ && !/^#\t\t/ {
+eval_this_line && NF >= 1 && !/^[\t.]/ && !/^#*$/ && !/^#\t\t/ {
w = ($1 ~ /^#[A-Z]/) ? substr($1, 2) : ($1 == "#") ? $2 : $1;
# Reduce VAR.<param>, VAR.${param} and VAR.* to VAR.
@@ -232,7 +233,7 @@ $1 ~ /:$/ {
print_noncomment_lines = no;
}
-$1 == "#" {
+eval_this_line && $1 == "#" {
comment_lines++;
}
@@ -245,6 +246,7 @@ index(tolower($0), topic) != 0 {
}
{
+ eval_this_line = substr($0, length($0)) != "\\";
last_fname = FILENAME;
}