From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-046.btinternet.com (mailomta7-sa.btinternet.com [213.120.69.13]) by sourceware.org (Postfix) with ESMTPS id 9A90C3854158 for ; Mon, 31 Oct 2022 09:59:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A90C3854158 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from sa-prd-rgout-001.btmx-prd.synchronoss.net ([10.2.38.4]) by sa-prd-fep-046.btinternet.com with ESMTP id <20221031095931.UVXN3113.sa-prd-fep-046.btinternet.com@sa-prd-rgout-001.btmx-prd.synchronoss.net>; Mon, 31 Oct 2022 09:59:31 +0000 Authentication-Results: btinternet.com; auth=pass (LOGIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 62E573CC0E533759 X-Originating-IP: [86.139.199.187] X-OWM-Source-IP: 86.139.199.187 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvgedruddvgddvfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeehuedutdehhfeutefgieefgfelieettdeigfdtfffhvdevgeegteejfeeftdehgfenucfkphepkeeirddufeelrdduleelrddukeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpihhnvghtpeekiedrudefledrudelledrudekjedpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdprhgtphhtthhopehnvgiflhhisgesshhouhhrtggvfigrrhgvrdhorhhg X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (86.139.199.187) by sa-prd-rgout-001.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 62E573CC0E533759; Mon, 31 Oct 2022 09:59:31 +0000 From: Jon Turney To: newlib@sourceware.org Cc: Jon Turney Subject: [PATCH] makedocbook: Fix false report of unhandled texinfo command Date: Mon, 31 Oct 2022 09:59:14 +0000 Message-Id: <20221031095914.2277-1-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1198.4 required=5.0 tests=BAYES_00,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: During 'make man', makedocbook falsely reports "texinfo command '@modifier' remains in output" while processing the setlocal(3) manpage, which contains that literal string. Move the check for unrecognized texinfo commands to before processing '@@' (an escaped '@') in the texinfo source, and teach it to ignore them. Improve that check slightly, so it catches non-alphabetic texinfo commands, of which there are few. Now we don't have false positives, we can make unrecognized texinfo commands fatal to manpage generation, rather than leaving them verbatim in the generated manpage. --- newlib/doc/makedocbook.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/newlib/doc/makedocbook.py b/newlib/doc/makedocbook.py index 4e83ab63a..00b3fc140 100755 --- a/newlib/doc/makedocbook.py +++ b/newlib/doc/makedocbook.py @@ -454,9 +454,6 @@ command_dispatch_dict = { def line_markup_convert(p): s = p; - # process the texinfo escape for an @ - s = s.replace('@@', '@') - # escape characters not allowed in XML s = s.replace('&','&') s = s.replace('<','<') @@ -486,6 +483,15 @@ def line_markup_convert(p): # very hacky way of dealing with @* to force a newline s = s.replace('@*', '') + # fail if there are unhandled texinfo commands + match = re.search('(? 3) and (s != p): print('%s-> line_markup_convert ->\n%s' % (p, s), file=sys.stderr) @@ -827,10 +833,6 @@ def main(file): print(s) - # warn about texinfo commands which didn't get processed - match = re.search('@[a-z*]+', s) - if match: - print('texinfo command %s remains in output' % match.group(), file=sys.stderr) # # -- 2.38.1