summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-08-02 10:50:00 +0000
committerrillig <rillig@pkgsrc.org>2006-08-02 10:50:00 +0000
commit0d658e0cae47a5fa977bb6d3120fc9f65462e3ce (patch)
treeb9d55afc331efd624129c413d1241f06f297956b /mk
parent383423e5b537c39a9f173b75e637a635d915143b (diff)
downloadpkgsrc-0d658e0cae47a5fa977bb6d3120fc9f65462e3ce.tar.gz
If the first word after the "#" is a variable name, the line above must
have been empty to qualify as a comment. Otherwise "make help TOPIC=configure" shows a lot of misleading contents. Removed the duplicate appearance of RCS Ids in the help texts, which often occured when the help text was the header comment of a file.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.help.mk25
1 files changed, 19 insertions, 6 deletions
diff --git a/mk/bsd.pkg.help.mk b/mk/bsd.pkg.help.mk
index aff52f3045f..ce5fa4b5a74 100644
--- a/mk/bsd.pkg.help.mk
+++ b/mk/bsd.pkg.help.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.help.mk,v 1.2 2006/08/02 10:29:47 rillig Exp $
+# $NetBSD: bsd.pkg.help.mk,v 1.3 2006/08/02 10:50:00 rillig Exp $
#
# This is the integrated pkgsrc online help system. To query for the
@@ -22,15 +22,22 @@ _HELP_AWK= \
hline = hline hline hline hline hline; \
found = no; var = no; comment = no; n = 0; \
rcsid = ""; \
+ last_line_was_rcsid = no; \
+ last_line_was_empty = yes; \
} \
/./ { \
- lines[n++] = $$0; \
- } \
- /^\\#.*\$$.*\$$$$/ { \
- rcsid = $$0; \
+ if ($$0 ~ /^\\#.*\$$.*\$$$$/) { \
+ rcsid = $$0; \
+ last_line_was_rcsid = yes; \
+ } else { \
+ if (!(last_line_was_rcsid && $$0 == "\#")) { \
+ lines[n++] = $$0; \
+ } \
+ last_line_was_rcsid = no; \
+ } \
} \
($$1 == VARNAME"?=") || ($$1 == "\#"VARNAME"=") \
- || ($$1 == "\#" && $$2 == VARNAME) { \
+ || ($$1 == "\#" && $$2 == VARNAME && last_line_was_empty) { \
var = 1; \
} \
/^\#/ { \
@@ -45,6 +52,12 @@ _HELP_AWK= \
} \
var = no; comment = no; n = 0; \
} \
+ /./ { \
+ last_line_was_empty = no; \
+ } \
+ /^\\#$$/ || /^$$/ { \
+ last_line_was_empty = yes; \
+ } \
END { \
if (found) { \
print hline; \