From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oJteJMHNKWTuuAAASxT56A (envelope-from ) for ; Sun, 02 Apr 2023 20:47:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kPFeJMHNKWTDWgAA9RJhRA (envelope-from ) for ; Sun, 02 Apr 2023 20:47:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5734A1357F for ; Sun, 2 Apr 2023 20:47:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pj2jM-0001Ok-Hp; Sun, 02 Apr 2023 14:47:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj2jK-0001OE-5a for guix-patches@gnu.org; Sun, 02 Apr 2023 14:47:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pj2jG-0007E7-MU; Sun, 02 Apr 2023 14:47:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pj2jG-0007Ep-AJ; Sun, 02 Apr 2023 14:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62625] [PATCH] po: Do not auto-translate cross-references to other manuals. Resent-From: Florian Pelz Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Sun, 02 Apr 2023 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62625 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62625@debbugs.gnu.org Cc: Florian Pelz , ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168046117727757 (code B ref -1); Sun, 02 Apr 2023 18:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Apr 2023 18:46:17 +0000 Received: from localhost ([127.0.0.1]:42656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj2iX-0007Dd-ES for submit@debbugs.gnu.org; Sun, 02 Apr 2023 14:46:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:57960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj2iT-0007DR-5d for submit@debbugs.gnu.org; Sun, 02 Apr 2023 14:46:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj2iQ-0001KG-0G for guix-patches@gnu.org; Sun, 02 Apr 2023 14:46:11 -0400 Received: from relay.yourmailgateway.de ([188.68.63.170]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj2iI-00078z-La for guix-patches@gnu.org; Sun, 02 Apr 2023 14:46:09 -0400 Received: from mors-relay8203.netcup.net (localhost [127.0.0.1]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4PqNJj2852z8Yx9 for ; Sun, 2 Apr 2023 18:45:57 +0000 (UTC) Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4PqNJj1RHWz8Yx8 for ; Sun, 2 Apr 2023 18:45:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4PqNJh1hfbz8tY1 for ; Sun, 2 Apr 2023 20:45:56 +0200 (CEST) Received: from florianrock64.fritz.box (ip92344de0.dynamic.kabel-deutschland.de [146.52.77.224]) by mxe217.netcup.net (Postfix) with ESMTPSA id 03AF280974; Sun, 2 Apr 2023 20:45:54 +0200 (CEST) From: Florian Pelz Date: Sun, 2 Apr 2023 20:44:01 +0200 Message-Id: <20230402184401.14505-1-pelzflorian@pelzflorian.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-NC-CID: Kx0Vqk5iYGOPVTsFH8zMOub4osxEkb0th/nnHgTE06G62KdxI2Hl9Vv3 Received-SPF: none client-ip=188.68.63.170; envelope-from=pelzflorian@pelzflorian.de; helo=relay.yourmailgateway.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_NONE=0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680461249; a=rsa-sha256; cv=none; b=lO7YgauK47jKXd89YlW00tuJvQj79AU5U81zxqk9urj9QfWpIbAWNmKFEpKnQylVWMmkTI GcDfB59vZ0tSC0xiuNfq+2tEg864AUFOJ9RfNtxk8oiUOpApaiZ7VtycWpTNUVQo6euZc2 cS1Q1iS6lC0oO3dNdxEmpuSxKCEqjt9X/n0eR1Aq4vFP/Gvq6E4L536KEdmk3D/lKwThiF nPUU8ilSTnnlRX6C8J/hHtsvHVZSLQr3ObMU5wmUp2jtRAScwLaSQFHUSVQ1KnVUdtOQW2 j65I0KZbKUi9Em3M0N9LdaIWlP5L1kxcKci5PkP9HI8jJv75aLeaob4R+gnDEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680461249; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UVR8dJlsVpUro5yXF8npadVvCAxz2MvLXFF4vQh9GNE=; b=G2OQgEz1jb83USdpH028rA6hb9QHiBfyIC8f80XoWXoIVS7pOF0yrIHfwVS/gLwqlC/SNS Y09bSHhR+KL3XqqLhS8KdsmGV2o8UgmGQiA5XTie9PGG22QF0z6eUlXvkTeEPaAYssfjCf IFeuFObO+siOjPKJJL8iTEXUFWCSB6hearffSOHJu4r75os89wVY7uThUFuPEtC/j4SfPq eIZNpdvzt0mojR60Md9vbc1WgyPVanGX8hVzD3u5pE6/lkyAQtwwXk52G1ypi3f//P2RWn mnqjQuaR8lmF2FnFLytiN+CaK2oHoV/bMZNF/m70gOKWnJvuSBedGHgdlMOxTA== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -2.43 X-Spam-Score: -2.43 X-Migadu-Queue-Id: 5734A1357F X-TUID: VcxVBihmrW2d Reported by Gottfried at . * guix/build/po.scm (xref-regexp): Dispatch on the number of arguments. Ensure there is no info-manual argument or it is empty. (translate-cross-references): Adapt to changed regexp. --- guix/build/po.scm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/guix/build/po.scm b/guix/build/po.scm index 7f88164cd8..62362e933e 100644 --- a/guix/build/po.scm +++ b/guix/build/po.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019, 2021 Julien Lepiller ;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2023 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -123,7 +124,15 @@ (define (canonicalize-whitespace str) (define xref-regexp ;; Texinfo cross-reference regexp. - (make-regexp "@(px|x)?ref\\{([^,}]+)")) + (make-regexp + (string-append "@(px|x)?ref\\{([^,}]+)(" + "\\}" ;Match xref with one argument + "|,[^,}]*\\}" ;or two arguments + "|,[^,}]*,[^,}]*\\}" ;or three arguments + ;; or with an *empty* fourth argument: + "|,[^,}]*,[^,}]*, *," + "|,[^,}]*,[^,}]*, *\\}" + ")"))) (define (translate-cross-references texi pofile) "Translate the cross-references that appear in @var{texi}, the initial @@ -157,13 +166,15 @@ (define translated (cons (string-drop content offset) result))) ((head . tail) (let ((prefix (match:substring head 1)) - (ref (canonicalize-whitespace (match:substring head 2)))) + (ref (canonicalize-whitespace (match:substring head 2))) + (rest (match:substring head 3))) (define translated (string-append "@" (or prefix "") "ref{" (match (vhash-assoc ref translation-map) (#f ref) - ((_ . str) str)))) + ((_ . str) str)) + (or rest ""))) (loop tail (match:end head) base-commit: 47ea688fd27d0ce0c8ea5481f1f94d0ebc3e37eb -- 2.39.2