Received: by mail.netbsd.org (Postfix, from userid 605) id 0A52184D95; Sun, 3 May 2020 08:49:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 864AC84D71 for ; Sun, 3 May 2020 08:49:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id HPbr1jxb-F20 for ; Sun, 3 May 2020 08:49:17 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 0A40984D2C for ; Sun, 3 May 2020 08:49:17 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 02C97FB27; Sun, 3 May 2020 08:49:17 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1588495756123930" MIME-Version: 1.0 Date: Sun, 3 May 2020 08:49:16 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20200503084917.02C97FB27@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. --_----------=_1588495756123930 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun May 3 08:49:16 UTC 2020 Modified Files: pkgsrc/mk/help: help.awk pkgsrc/regress/infra-unittests: help.sh Log Message: mk/help: only list help topics that have associated keywords To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 pkgsrc/mk/help/help.awk cvs rdiff -u -r1.2 -r1.3 pkgsrc/regress/infra-unittests/help.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1588495756123930 Content-Disposition: inline Content-Length: 2057 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.35 pkgsrc/mk/help/help.awk:1.36 --- pkgsrc/mk/help/help.awk:1.35 Mon Mar 30 06:21:52 2020 +++ pkgsrc/mk/help/help.awk Sun May 3 08:49:16 2020 @@ -1,4 +1,4 @@ -# $NetBSD: help.awk,v 1.35 2020/03/30 06:21:52 rillig Exp $ +# $NetBSD: help.awk,v 1.36 2020/05/03 08:49:16 rillig Exp $ # # This program extracts the inline documentation from *.mk files. @@ -35,7 +35,7 @@ BEGIN { # end of a file or by the end of all files. When there have been enough # comment lines, the topic is considered worth printing. # -function end_of_topic() { +function end_of_topic( relevant, has_keywords) { if (comment_lines <= 2 || ignore_this_section) { if (array_is_empty(keywords)) { @@ -52,7 +52,13 @@ function end_of_topic() { for (k in keywords) all_keywords[k]++; - relevant = (topic in keywords || lctopic in keywords || uctopic in keywords || topic == ":all"); + relevant = no; + if (topic == ":all") + for (k in keywords) + relevant = yes; + if (topic in keywords || lctopic in keywords || uctopic in keywords) + relevant = yes; + if (relevant && !print_index) { if (found_anything) Index: pkgsrc/regress/infra-unittests/help.sh diff -u pkgsrc/regress/infra-unittests/help.sh:1.2 pkgsrc/regress/infra-unittests/help.sh:1.3 --- pkgsrc/regress/infra-unittests/help.sh:1.2 Sun May 3 08:42:22 2020 +++ pkgsrc/regress/infra-unittests/help.sh Sun May 3 08:49:16 2020 @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: help.sh,v 1.2 2020/05/03 08:42:22 rillig Exp $ +# $NetBSD: help.sh,v 1.3 2020/05/03 08:49:16 rillig Exp $ # # Test cases for "bmake help", mainly implemented in mk/help/help.awk. # @@ -110,13 +110,8 @@ if test_case_begin "comments without key TOPIC=':all' awk -f "$pkgsrcdir/mk/help/help.awk" \ 'Makefile' >"out" - # FIXME: should be empty assert_that 'out' --file-is-lines \ - '===> Makefile (keywords:):' \ - '# Comment1' \ - '# Comment2' \ - '# Comment3' \ - 'SUBDIR+= subdir2' + 'No help found for :all.' test_case_end fi --_----------=_1588495756123930--