From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-048.btinternet.com (mailomta2-re.btinternet.com [213.120.69.95]) by sourceware.org (Postfix) with ESMTPS id 11933385802D for ; Fri, 4 Nov 2022 13:50:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 11933385802D 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 re-prd-rgout-001.btmx-prd.synchronoss.net ([10.2.54.4]) by re-prd-fep-048.btinternet.com with ESMTP id <20221104135017.EWYN3057.re-prd-fep-048.btinternet.com@re-prd-rgout-001.btmx-prd.synchronoss.net>; Fri, 4 Nov 2022 13:50:17 +0000 Authentication-Results: btinternet.com; none X-SNCR-Rigid: 613A8CC3410428A4 X-Originating-IP: [81.153.98.206] X-OWM-Source-IP: 81.153.98.206 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvgedrvddugdehgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeeliedtjefhtdevkeehueegffegveeftdejjeevfefhiefffeektddvteehheeijeenucfkphepkedurdduheefrdelkedrvddtieenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkedurdduheefrdelkedrvddtiedpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdprhgtphhtthhopehnvgiflhhisgesshhouhhrtggvfigrrhgvrdhorhhg X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (81.153.98.206) by re-prd-rgout-001.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 613A8CC3410428A4; Fri, 4 Nov 2022 13:50:17 +0000 From: Jon Turney To: newlib@sourceware.org Cc: Jon Turney Subject: [PATCH 5/5] makedocbook: Fix false report of unhandled texinfo command Date: Fri, 4 Nov 2022 13:49:46 +0000 Message-Id: <20221104134946.13443-6-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221104134946.13443-1-jon.turney@dronecode.org.uk> References: <20221104134946.13443-1-jon.turney@dronecode.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1196.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_BARRACUDACENTRAL,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 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/newlib/doc/makedocbook.py b/newlib/doc/makedocbook.py index 4de20ef92..9c5615f22 100755 --- a/newlib/doc/makedocbook.py +++ b/newlib/doc/makedocbook.py @@ -450,9 +450,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('<', '<') @@ -482,6 +479,14 @@ 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(r'(? 3) and (s != p): print('%s-> line_markup_convert ->\n%s' % (p, s), file=sys.stderr) @@ -823,10 +828,6 @@ def main(file): print(s) - # warn about texinfo commands which didn't get processed - match = re.search(r'@[a-z*]+', s) - if match: - print('texinfo command %s remains in output' % match.group(), file=sys.stderr) # # -- 2.38.1