Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/help mk/help: make variable more precise
details: https://anonhg.NetBSD.org/pkgsrc/rev/8dc5cb5c8801
branches: trunk
changeset: 430678:8dc5cb5c8801
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun May 03 09:44:07 2020 +0000
description:
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:
mk/help/help.awk | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (53 lines):
diff -r f61b8fbcc1b6 -r 8dc5cb5c8801 mk/help/help.awk
--- a/mk/help/help.awk Sun May 03 09:22:16 2020 +0000
+++ b/mk/help/help.awk Sun May 03 09:44:07 2020 +0000
@@ -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 @@
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 @@
}
{
- 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 @@
keywords[w] = yes;
dprint("Adding keyword \"" w "\"");
}
- ignore_this_line = yes;
+ print_this_line = no;
ignore_next_empty_line = yes;
}
@@ -170,7 +170,7 @@
end_of_topic();
}
-(!ignore_this_line) {
+print_this_line {
lines[nlines++] = $0;
}
Home |
Main Index |
Thread Index |
Old Index