Received: by mail.netbsd.org (Postfix, from userid 605) id 8E1B484D78; Sun, 3 May 2020 10:51:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 1674B84D48 for ; Sun, 3 May 2020 10:51:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 3KcOKmAdG1Gi for ; Sun, 3 May 2020 10:51:06 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 8A93384D02 for ; Sun, 3 May 2020 10:51:06 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 7E702FB27; Sun, 3 May 2020 10:51:06 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_158850306683620" MIME-Version: 1.0 Date: Sun, 3 May 2020 10:51:06 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/mk/help To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20200503105106.7E702FB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_158850306683620 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun May 3 10:51:06 UTC 2020 Modified Files: pkgsrc/mk/help: help.awk Log Message: mk/help: remove negation from variable names To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 pkgsrc/mk/help/help.awk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_158850306683620 Content-Disposition: inline Content-Length: 2784 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/help/help.awk diff -u pkgsrc/mk/help/help.awk:1.39 pkgsrc/mk/help/help.awk:1.40 --- pkgsrc/mk/help/help.awk:1.39 Sun May 3 09:51:07 2020 +++ pkgsrc/mk/help/help.awk Sun May 3 10:51:06 2020 @@ -1,4 +1,4 @@ -# $NetBSD: help.awk,v 1.39 2020/05/03 09:51:07 rillig Exp $ +# $NetBSD: help.awk,v 1.40 2020/05/03 10:51:06 rillig Exp $ # # This program extracts the inline documentation from *.mk files. @@ -18,8 +18,8 @@ BEGIN { last_fname = ""; eval_this_line = yes; print_this_line = yes; - ignore_next_empty_line = no; - ignore_this_section = no; + eval_next_empty_line = yes; + print_this_section = yes; delete lines; # the collected lines nlines = 0; # the number of lines collected so far @@ -43,7 +43,7 @@ function end_of_topic( relevant, has_k ? "Ignoring section because of missing keywords." \ : comment_lines <= 2 \ ? "Ignoring section because of too small comment." \ - : ignore_this_section \ + : !print_this_section \ ? "Ignoring section because of a previous decision." \ : ""; @@ -99,13 +99,13 @@ function sorted_keys(array, prefix, el } function cleanup() { - ignore_next_empty_line = yes; + eval_next_empty_line = no; delete lines; nlines = 0; delete keywords; comment_lines = 0; print_noncomment_lines = yes; - ignore_this_section = no; + print_this_section = yes; } function dprint(msg) { @@ -128,22 +128,22 @@ function array_is_empty(arr, i, empty) } { - print_this_line = $0 != "" && !(ignore_next_empty_line && $0 == "#"); - ignore_next_empty_line = no; + print_this_line = $0 != "" && !(!eval_next_empty_line && $0 == "#"); + eval_next_empty_line = yes; } # There is no need to print the RCS Id, since the full pathname # is prefixed to the file contents. /^#.*\$.*\$$/ { print_this_line = no; - ignore_next_empty_line = yes; + eval_next_empty_line = no; } # The lines containing the keywords should also not appear in # the output for now. This decision is not final since it may # be helpful for the user to know by which keywords a topic # can be reached. -($1 == "#" && $2 == "Keywords:") { +$1 == "#" && $2 == "Keywords:" { for (i = 3; i <= NF; i++) { w = ($i == toupper($i)) ? tolower($i) : $i; sub(/,$/, "", w); @@ -151,16 +151,16 @@ function array_is_empty(arr, i, empty) dprint("Adding keyword \"" w "\""); } print_this_line = no; - ignore_next_empty_line = yes; + eval_next_empty_line = no; } -($0 == "#") { - ignore_next_empty_line = no; +$0 == "#" { + eval_next_empty_line = yes; } $1 == "#" && $2 == "Copyright" { dprint("Ignoring the section because it contains \"Copyright\"."); - ignore_this_section = yes; + print_this_section = no; } # Don't show the user the definition of make targets, since they are --_----------=_158850306683620--