diff options
author | rillig <rillig@pkgsrc.org> | 2006-08-02 10:50:00 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-08-02 10:50:00 +0000 |
commit | 5901d7142a2ed464bddafe3a67149198f13e1647 (patch) | |
tree | b9d55afc331efd624129c413d1241f06f297956b | |
parent | 982bf4bef134770e90bcc4ddc5721446f2046be6 (diff) | |
download | pkgsrc-5901d7142a2ed464bddafe3a67149198f13e1647.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.
-rw-r--r-- | mk/bsd.pkg.help.mk | 25 |
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; \ |