From unknown Fri Jun 20 18:18:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#51122 <51122@debbugs.gnu.org> To: bug#51122 <51122@debbugs.gnu.org> Subject: Status: [PATCH] maint: Factorize po xref translation. Reply-To: bug#51122 <51122@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:18:33 +0000 retitle 51122 [PATCH] maint: Factorize po xref translation. reassign 51122 guix-patches submitter 51122 Julien Lepiller severity 51122 normal tag 51122 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 17:33:16 2021 Received: (at submit) by debbugs.gnu.org; 10 Oct 2021 21:33:16 +0000 Received: from localhost ([127.0.0.1]:55927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZgRX-0001Xm-VA for submit@debbugs.gnu.org; Sun, 10 Oct 2021 17:33:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:48024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZgRT-0001Xc-Bo for submit@debbugs.gnu.org; Sun, 10 Oct 2021 17:33:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZgRS-00055P-NT for guix-patches@gnu.org; Sun, 10 Oct 2021 17:33:11 -0400 Received: from lepiller.eu ([89.234.186.109]:33194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZgRP-0007qP-Ja for guix-patches@gnu.org; Sun, 10 Oct 2021 17:33:10 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 66f1dfe7 for ; Sun, 10 Oct 2021 21:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=dkim; bh=WIXRb5FE/3JUfiw96S0Atow+8 NSdZvwizOnoanlYzTA=; b=QMzYKQDi1PYfKMq7Ynjidcs0i9mTIKtCcPC0qfNeN 9yvJ01JavZcshEtQNbd3h+Vs7kuFp9PbLNMphwLd6s8QKqdnGuJCrPGd+gvFQJei fQK/RIRFWkkA34gMN/8wgcXhixZ7Z+OxV+k8bvgAcfsCDW2LfM/NZ7QGGpWF2Y+H 1UxPoE2QFjCJTLvSqLLlQfSnzh+K60RNmMAwYN3Q/U8wOF/SKni5h5dQbYxWwJmV X4iUdn+wnWkCGoi4KIUs3dR/1tl+uf1bUNeTVyDQFlBvKeSBEbkXgxuS/Zs4/QU9 m7nXp7xt9CfgkM9LsDqwgr71V/0TknHUAY7F5C9n7u3Jg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ed9c56a7 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Sun, 10 Oct 2021 21:32:56 +0000 (UTC) From: Julien Lepiller To: guix-patches@gnu.org Subject: [PATCH] maint: Factorize po xref translation. Date: Sun, 10 Oct 2021 23:32:50 +0200 Message-Id: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This ensures we use the same method in "make" as in "guix/self.scm". * Makefile.am: Build guix/build/po.scm. * build-aux/convert-xref.scm: New file. * doc/local.mk (xref_command): Use it. * guix/self.scm (translate-cross-references): Move it... * guix/build/po.scm (translate-cross-references): ...here. --- Makefile.am | 3 +- build-aux/convert-xref.scm | 26 +++++++++ doc/local.mk | 29 +++------- guix/build/po.scm | 115 +++++++++++++++++++++++++++++++++++-- guix/self.scm | 80 ++++---------------------- 5 files changed, 155 insertions(+), 98 deletions(-) create mode 100644 build-aux/convert-xref.scm diff --git a/Makefile.am b/Makefile.am index 635147efc1..dc53b2c810 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,6 @@ nodist_noinst_SCRIPTS = \ # Modules that are not compiled but are installed nonetheless, such as # build-side modules with unusual dependencies. MODULES_NOT_COMPILED = \ - guix/build/po.scm \ guix/man-db.scm include gnu/local.mk @@ -227,6 +226,7 @@ MODULES = \ guix/build/pack.scm \ guix/build/utils.scm \ guix/build/union.scm \ + guix/build/po.scm \ guix/build/profiles.scm \ guix/build/compile.scm \ guix/build/rpath.scm \ @@ -640,6 +640,7 @@ EXTRA_DIST += \ build-aux/check-final-inputs-self-contained.scm \ build-aux/check-channel-news.scm \ build-aux/compile-as-derivation.scm \ + build-aux/convert-xref.scm \ build-aux/generate-authors.scm \ build-aux/test-driver.scm \ build-aux/update-guix-package.scm \ diff --git a/build-aux/convert-xref.scm b/build-aux/convert-xref.scm new file mode 100644 index 0000000000..47c8828857 --- /dev/null +++ b/build-aux/convert-xref.scm @@ -0,0 +1,26 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Julien Lepiller +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +;; Translate cross-references in a translated .texi manual. + +(use-modules (guix build po) + (ice-9 match)) + +(match (command-line) + ((program texi pofile) + (translate-cross-references texi pofile))) diff --git a/doc/local.mk b/doc/local.mk index 8340b75a87..88f7e67155 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -97,44 +97,29 @@ PO4A_PARAMS += -k 0 # produce an output even if the translation is not complete PO4A_PARAMS += -f texinfo # texinfo format # When a change to guix.texi occurs, it is not translated immediately. -# Because @pxref and @xref commands are reference to a section by name, they +# Because @pxref and @xref commands are references to sections by name, they # should be translated. If a modification adds a reference to a section, this # reference is not translated, which means it references a section that does not # exist. -# This command loops through the translated files looking for references. For -# each of these references, it tries to find the translation and replaces the -# reference name, even in untranslated strings. -# The last sed is a multiline sed because some references span multiple lines. define xref_command -cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \ - tr -d '\012' | sed 's|\(@p\?x\?ref\)|\n\1|g' | egrep '@p?x?ref' | \ - sed 's|^.*@p\?x\?ref{\([^,}]*\).*$$|\1|g' | sort | uniq | while read e; do \ - if [ -n "$$e" ]; then \ - line=$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=":") ;\ - ((line++)) ;\ - if [ "$$line" != "1" ]; then \ - translation=$$(head -n "$$line" "$<" | tail -1 | grep msgstr | sed 's|msgstr "\([^"]*\)"|\1|') ;\ - if [ "$$translation" != "" ]; then \ - sed "N;s@\(p\?x\?ref\){$$(echo $$e | sed 's| |[\\n ]|g')\(,\|}\)@\1{$$translation\2@g;P;D" -i "$@.tmp" ;\ - fi ;\ - fi ;\ - fi ;\ -done +$(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \ + "$(top_srcdir)/build-aux/convert-xref.scm" \ + $@.tmp $< endef -$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi +$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi make-go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp" -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" -$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po +$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po make-go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi" -p "$<" -l "$@.tmp" -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" -$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po +$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po make-go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" diff --git a/guix/build/po.scm b/guix/build/po.scm index eb9690ad1a..a167252244 100644 --- a/guix/build/po.scm +++ b/guix/build/po.scm @@ -20,17 +20,23 @@ (define-module (guix build po) #:use-module (ice-9 match) #:use-module (ice-9 peg) + #:use-module (ice-9 regex) #:use-module (ice-9 textual-ports) - #:export (read-po-file)) + #:use-module (ice-9 vlist) + #:use-module (srfi srfi-1) + #:export (read-po-file + translate-cross-references)) ;; A small parser for po files -(define-peg-pattern po-file body (* (or comment entry whitespace))) +(define-peg-pattern po-file body (* (or entry whitespace))) (define-peg-pattern whitespace body (or " " "\t" "\n")) (define-peg-pattern comment-chr body (range #\space #\頋)) (define-peg-pattern comment none (and "#" (* comment-chr) "\n")) +(define-peg-pattern flags all (and (ignore "#, ") (* comment-chr) (ignore "\n"))) (define-peg-pattern entry all - (and (ignore (* whitespace)) (ignore "msgid ") msgid - (ignore (* whitespace)) (ignore "msgstr ") msgstr)) + (and (* (or flags comment (ignore (* whitespace)))) + (ignore "msgid ") msgid (ignore (* whitespace)) + (ignore "msgstr ") msgstr)) (define-peg-pattern escape body (or "\\\\" "\\\"" "\\n")) (define-peg-pattern str-chr body (or " " "!" (and (ignore "\\") "\"") "\\n" (and (ignore "\\") "\\") @@ -53,7 +59,24 @@ (append (list "\n" prefix) result))))))) (define (parse-tree->assoc parse-tree) - "Converts a po PARSE-TREE to an association list." + "Converts a po PARSE-TREE to an association list, where the key is the msgid +and the value is the msgstr. The result only contains non fuzzy strings." + (define (comments->flags comments) + (match comments + (('flags flags) + (map (lambda (flag) (string->symbol (string-trim-both flag #\space))) + (string-split flags #\,))) + ((? list? comments) + (fold + (lambda (comment res) + (match comment + ((? string? _) res) + (flags + (append (comments->flags flags) + res)))) + '() + comments)))) + (match parse-tree (() '()) ((entry . parse-tree) @@ -66,10 +89,22 @@ ;; empty msgstr (('entry ('msgid msgid) 'msgstr) (parse-tree->assoc parse-tree)) + (('entry _ ('msgid msgid) 'msgstr) + (parse-tree->assoc parse-tree)) (('entry ('msgid msgid) ('msgstr msgstr)) (acons (interpret-newline-escape msgid) (interpret-newline-escape msgstr) - (parse-tree->assoc parse-tree))))))) + (parse-tree->assoc parse-tree))) + (('entry ('msgid msgid) ('msgstr msgstr)) + (acons (interpret-newline-escape msgid) + (interpret-newline-escape msgstr) + (parse-tree->assoc parse-tree))) + (('entry comments ('msgid msgid) ('msgstr msgstr)) + (if (member 'fuzzy (comments->flags comments)) + (parse-tree->assoc parse-tree) + (acons (interpret-newline-escape msgid) + (interpret-newline-escape msgstr) + (parse-tree->assoc parse-tree)))))))) (define (read-po-file port) "Read a .po file from PORT and return an alist of msgid and msgstr." @@ -77,3 +112,71 @@ po-file (get-string-all port))))) (parse-tree->assoc tree))) + +(define (canonicalize-whitespace str) + "Change whitespace (newlines, etc.) in STR to @code{#\\space}." + (string-map (lambda (chr) + (if (char-set-contains? char-set:whitespace chr) + #\space + chr)) + str)) + +(define xref-regexp + ;; Texinfo cross-reference regexp. + (make-regexp "@(px|x)?ref\\{([^,}]+)")) + +(define (translate-cross-references texi pofile) + "Translate the cross-references that appear in @var{texi}, the initial +translation of a Texinfo file, using the msgid/msgstr pairs from @var{pofile}." + (define translations + (call-with-input-file pofile read-po-file)) + + (define content + (call-with-input-file texi get-string-all)) + + (define matches + (list-matches xref-regexp content)) + + (define translation-map + (fold (match-lambda* + (((msgid . str) result) + (vhash-cons msgid str result))) + vlist-null + translations)) + + (define translated + ;; Iterate over MATCHES and replace cross-references with their + ;; translation found in TRANSLATION-MAP. (We can't use + ;; 'substitute*' because matches can span multiple lines.) + (let loop ((matches matches) + (offset 0) + (result '())) + (match matches + (() + (string-concatenate-reverse + (cons (string-drop content offset) result))) + ((head . tail) + (let ((prefix (match:substring head 1)) + (ref (canonicalize-whitespace (match:substring head 2)))) + (define translated + (string-append "@" (or prefix "") + "ref{" + (match (vhash-assoc ref translation-map) + (#f ref) + ((_ . str) str)))) + + (loop tail + (match:end head) + (append (list translated + (string-take + (string-drop content offset) + (- (match:start head) offset))) + result))))))) + + (format (current-error-port) + "translated ~a cross-references in '~a'~%" + (length matches) texi) + + (call-with-output-file texi + (lambda (port) + (display translated port)))) diff --git a/guix/self.scm b/guix/self.scm index 61ff423086..769e0e8a7c 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -316,81 +316,23 @@ the result to OUTPUT." chr)) str)) - (define xref-regexp - ;; Texinfo cross-reference regexp. - (make-regexp "@(px|x)?ref\\{([^,}]+)")) - - (define (translate-cross-references texi translations) - ;; Translate the cross-references that appear in TEXI, a Texinfo - ;; file, using the msgid/msgstr pairs from TRANSLATIONS. - (define content - (call-with-input-file texi get-string-all)) - - (define matches - (list-matches xref-regexp content)) - - (define translation-map - (fold (match-lambda* - (((msgid . str) result) - (vhash-cons msgid str result))) - vlist-null - translations)) - - (define translated - ;; Iterate over MATCHES and replace cross-references with their - ;; translation found in TRANSLATION-MAP. (We can't use - ;; 'substitute*' because matches can span multiple lines.) - (let loop ((matches matches) - (offset 0) - (result '())) - (match matches - (() - (string-concatenate-reverse - (cons (string-drop content offset) result))) - ((head . tail) - (let ((prefix (match:substring head 1)) - (ref (canonicalize-whitespace (match:substring head 2)))) - (define translated - (string-append "@" (or prefix "") - "ref{" - (match (vhash-assoc ref translation-map) - (#f ref) - ((_ . str) str)))) - - (loop tail - (match:end head) - (append (list translated - (string-take - (string-drop content offset) - (- (match:start head) offset))) - result))))))) - - (format (current-error-port) - "translated ~a cross-references in '~a'~%" - (length matches) texi) - (call-with-output-file texi - (lambda (port) - (display translated port)))) - (define* (translate-texi prefix po lang #:key (extras '())) "Translate the manual for one language LANG using the PO file. PREFIX must be the prefix of the manual, 'guix' or 'guix-cookbook'. EXTRAS is a list of extra files, such as '(\"contributing\")." - (let ((translations (call-with-input-file po read-po-file))) - (for-each (lambda (file) - (translate-tmp-texi po (string-append file ".texi") - (string-append file "." lang - ".texi.tmp"))) - (cons prefix extras)) + (for-each (lambda (file) + (translate-tmp-texi po (string-append file ".texi") + (string-append file "." lang + ".texi.tmp"))) + (cons prefix extras)) - (for-each (lambda (file) - (let* ((texi (string-append file "." lang ".texi")) - (tmp (string-append texi ".tmp"))) - (copy-file tmp texi) - (translate-cross-references texi - translations))) - (cons prefix extras)))) + (for-each (lambda (file) + (let* ((texi (string-append file "." lang ".texi")) + (tmp (string-append texi ".tmp"))) + (copy-file tmp texi) + (translate-cross-references texi po))) + (cons prefix extras))) (define (available-translations directory domain) ;; Return the list of available translations under DIRECTORY for -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 17:37:28 2021 Received: (at 51122) by debbugs.gnu.org; 10 Oct 2021 21:37:28 +0000 Received: from localhost ([127.0.0.1]:55934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZgVc-0001ds-4D for submit@debbugs.gnu.org; Sun, 10 Oct 2021 17:37:28 -0400 Received: from lepiller.eu ([89.234.186.109]:35264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZgVa-0001dj-7c for 51122@debbugs.gnu.org; Sun, 10 Oct 2021 17:37:26 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 393fea5a for <51122@debbugs.gnu.org>; Sun, 10 Oct 2021 21:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=13p/gG5aUJSz Vazq7FgcEL+WJjgcD/L3833/kHU65us=; b=UN8YAsAX4nhahKfxktkcU+5uPTJ/ BENfhLKSXQkS8/yFD16IuXhpfdTlMRkSRcKWAyVYeYGMPn8oPiYp/+gW3Aqf2cbz JrFDq3aaL1aRKNidABa5k/OVWmaDg45xu+BWZAvbwypL41vViyzzFzMIRYFXuq1i 5TAutUZRPurYVcC7ejQeAoWIjDV3Mp0/JXfKaSFD3hDHUtMaSt4fWkc2su+nCfBr gU5KSUGzq6Y/w/+keTDaVUvQrM6kottmNxnetMkOC436OyALfiC3UF6f3TxYS2em rJWOJ+NQqcjXmfrmc2jMXcuZeFBRQUoNU0thC58e6ktqujBKdZY95aVmrQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 139a3954 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <51122@debbugs.gnu.org>; Sun, 10 Oct 2021 21:37:23 +0000 (UTC) Date: Sun, 10 Oct 2021 23:37:11 +0200 From: Julien Lepiller To: 51122@debbugs.gnu.org Subject: Re: [bug#51122] [PATCH] maint: Factorize po xref translation. Message-ID: <20211010233711.23bb1e9e@tachikoma.lepiller.eu> In-Reply-To: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51122 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) For info, I built "make" and "make as-derivation" successfully with this patch. I need it because with recent changes in guix.texi, a lot of text has become fuzzy, including node names, which are translated by the current xref_command (in doc/local.mk), when they shouldn't. I improved the method we used for guix pull, and used it instead. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 04:46:00 2021 Received: (at 51122) by debbugs.gnu.org; 11 Oct 2021 08:46:00 +0000 Received: from localhost ([127.0.0.1]:56544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZqwZ-00005Y-QT for submit@debbugs.gnu.org; Mon, 11 Oct 2021 04:45:59 -0400 Received: from pelzflorian.de ([5.45.111.108]:60858 helo=mail.pelzflorian.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZqwV-00005O-Vw for 51122@debbugs.gnu.org; Mon, 11 Oct 2021 04:45:58 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id D243636069D; Mon, 11 Oct 2021 10:45:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1633941954; bh=Vaeq6cTaxWUQd17t7cBG5PPZa8jjFjJ0kvkrN2E5mCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=zzHZRNbEb6F+GI+5YzVuvTs94L+wOMppQvFDGxPvgx/t/nYsl9n/rg7grZeDBVDeb Vc2AobVzCVPDfE/t1iFwxn0X6HATC7FOlbIzPnrOJFAY177km0C3Wk0j0VvZAXmQU6 6vz0JsdXN5LguWpMXPMrpMztZ1dwe6p9ZWTe4dkI= Date: Mon, 11 Oct 2021 10:45:45 +0200 From: "pelzflorian (Florian Pelz)" To: Julien Lepiller Subject: Re: [bug#51122] [PATCH] maint: Factorize po xref translation. Message-ID: <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211010233711.23bb1e9e@tachikoma.lepiller.eu> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Julien! Thank you for replacing that hard-to-read sed script. 65;6003;1c On Sun, Oct 10, 2021 at 11:37:11PM +0200, Julien Lepiller wrote: > For info, I built "make" and "make as-derivation" successfully with > this patch. I need it because with recent changes in guix.texi, a lot > of text has become fuzzy, including node names, which are translated by > the current xref_command (in doc/local.mk), when they shouldn't. I > improved the method we used for guix pull, and used it instead. I think you should add to the commit message that your patch Fixes fuzzy translations being inserted. Your changes to guix/build/po.scm do more than just move code (which you mentioned in the commit message): you added parsing of “#, fuzzy” flags. You should update the copyright header for guix/build/po.scm. Otherwise LGTM, but I haven’t tested yet. (make now converts the xref after scheme modules are compiled, I think(?), so testing PO files takes longer for me on a clean checkout. But it is fine.) Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 08:46:47 2021 Received: (at 51122) by debbugs.gnu.org; 11 Oct 2021 12:46:47 +0000 Received: from localhost ([127.0.0.1]:57025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZuhW-00007Y-Pa for submit@debbugs.gnu.org; Mon, 11 Oct 2021 08:46:47 -0400 Received: from lepiller.eu ([89.234.186.109]:35312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZuhU-0008UJ-Oa for 51122@debbugs.gnu.org; Mon, 11 Oct 2021 08:46:42 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 4b3fddac; Mon, 11 Oct 2021 12:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=5okbTg7Q0pXAHO9czDjAoZ9+BNJWfc5ZllMB6x J2Vds=; b=TcyagrwWStEsNFOJfO6bkgObZ3uh7gR7nbsbTgxttEuvxaOlQPC8WF vwnq1XAv/JrfL4Emvavglpk9oOEulQ+vckbDR3rKqc+Tyobmn81AOFGNK/qGFUhY lbp+nb5jA3V01UD479b43/55milaDWOZ7hy5hBEfMzZByGQl9oAJC3svRnNWutJ+ 4MLmy3eoiFU+O6/00YVPXHqWAu3QPC78NOKCNeZ4xHODjNpMHmqs6hP4tR0WaGv8 Z9sSqeJCsN2UUyCVl/AlBirAWC2a8nmAAEZRirnf2awYjM11fuybKxNwwm+TgdAo YVq3OaIGVukiz4vKayCv4Tk6xug3LcgQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id d3b219e6 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 11 Oct 2021 12:46:35 +0000 (UTC) Date: Mon, 11 Oct 2021 14:46:26 +0200 From: Julien Lepiller To: "pelzflorian (Florian Pelz)" Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211011144626.0049af43@tachikoma.lepiller.eu> In-Reply-To: <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/rT0vi8_QcOgtQ61Cv5jhSxv" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/rT0vi8_QcOgtQ61Cv5jhSxv Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Mon, 11 Oct 2021 10:45:45 +0200, "pelzflorian (Florian Pelz)" a =C3=A9crit : > Hi Julien! Thank you for replacing that hard-to-read sed script. > 65;6003;1c > On Sun, Oct 10, 2021 at 11:37:11PM +0200, Julien Lepiller wrote: > > For info, I built "make" and "make as-derivation" successfully with > > this patch. I need it because with recent changes in guix.texi, a > > lot of text has become fuzzy, including node names, which are > > translated by the current xref_command (in doc/local.mk), when they > > shouldn't. I improved the method we used for guix pull, and used it > > instead. =20 >=20 > I think you should add to the commit message that your patch Fixes > fuzzy translations being inserted. >=20 > Your changes to guix/build/po.scm do more than just move code (which > you mentioned in the commit message): you added parsing of =E2=80=9C#, fu= zzy=E2=80=9D > flags. >=20 > You should update the copyright header for guix/build/po.scm. >=20 > Otherwise LGTM, but I haven=E2=80=99t tested yet. (make now converts the= xref > after scheme modules are compiled, I think(?), so testing PO files > takes longer for me on a clean checkout. But it is fine.) >=20 > Regards, > Florian Thanks for the quick review! I've updated the commit message and updated the copyright headers in guix/build/po.scm and guix/self.scm. I had to make the texi files depend on make-go because otherwise, I get messages like "guix/build/po.scm is newer than compiled .../guix/build/po.go" and it takes forever to build that file, once for each texi. For some reason, it's almost instantaneous when building in make-go. --MP_/rT0vi8_QcOgtQ61Cv5jhSxv Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-maint-Factorize-po-xref-translation.patch =46rom 75198f83fccf27b447e5eaaa6fb6caeed3b29408 Mon Sep 17 00:00:00 2001 Message-Id: <75198f83fccf27b447e5eaaa6fb6caeed3b29408.1633955976.git.julien= @lepiller.eu> From: Julien Lepiller Date: Sun, 10 Oct 2021 22:07:51 +0200 Subject: [PATCH] maint: Factorize po xref translation. This ensures we use the same method in "make" as in "guix/self.scm". * Makefile.am: Build guix/build/po.scm. * build-aux/convert-xref.scm: New file. * doc/local.mk (xref_command): Use it. * guix/self.scm (translate-cross-references): Move it... * guix/build/po.scm: Parse comments and flags separately to find fuzzy flags. (translate-cross-references): ...here. (parse-tree->assoc): Ignore fuzzy entries. --- Makefile.am | 3 +- build-aux/convert-xref.scm | 26 +++++++++ doc/local.mk | 29 +++------ guix/build/po.scm | 117 ++++++++++++++++++++++++++++++++++--- guix/self.scm | 81 ++++--------------------- 5 files changed, 157 insertions(+), 99 deletions(-) create mode 100644 build-aux/convert-xref.scm diff --git a/Makefile.am b/Makefile.am index 635147efc1..dc53b2c810 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,6 @@ nodist_noinst_SCRIPTS =3D \ # Modules that are not compiled but are installed nonetheless, such as # build-side modules with unusual dependencies. MODULES_NOT_COMPILED =3D \ - guix/build/po.scm \ guix/man-db.scm =20 include gnu/local.mk @@ -227,6 +226,7 @@ MODULES =3D \ guix/build/pack.scm \ guix/build/utils.scm \ guix/build/union.scm \ + guix/build/po.scm \ guix/build/profiles.scm \ guix/build/compile.scm \ guix/build/rpath.scm \ @@ -640,6 +640,7 @@ EXTRA_DIST +=3D \ build-aux/check-final-inputs-self-contained.scm \ build-aux/check-channel-news.scm \ build-aux/compile-as-derivation.scm \ + build-aux/convert-xref.scm \ build-aux/generate-authors.scm \ build-aux/test-driver.scm \ build-aux/update-guix-package.scm \ diff --git a/build-aux/convert-xref.scm b/build-aux/convert-xref.scm new file mode 100644 index 0000000000..47c8828857 --- /dev/null +++ b/build-aux/convert-xref.scm @@ -0,0 +1,26 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Julien Lepiller +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +;; Translate cross-references in a translated .texi manual. + +(use-modules (guix build po) + (ice-9 match)) + +(match (command-line) + ((program texi pofile) + (translate-cross-references texi pofile))) diff --git a/doc/local.mk b/doc/local.mk index 8340b75a87..88f7e67155 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -97,44 +97,29 @@ PO4A_PARAMS +=3D -k 0 # produce an output even if the t= ranslation is not complete PO4A_PARAMS +=3D -f texinfo # texinfo format =20 # When a change to guix.texi occurs, it is not translated immediately. -# Because @pxref and @xref commands are reference to a section by name, th= ey +# Because @pxref and @xref commands are references to sections by name, th= ey # should be translated. If a modification adds a reference to a section, t= his # reference is not translated, which means it references a section that do= es not # exist. -# This command loops through the translated files looking for references. = For -# each of these references, it tries to find the translation and replaces = the -# reference name, even in untranslated strings. -# The last sed is a multiline sed because some references span multiple li= nes. define xref_command -cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g= ' | \ - tr -d '\012' | sed 's|\(@p\?x\?ref\)|\n\1|g' | egrep '@p?x?ref' | \ - sed 's|^.*@p\?x\?ref{\([^,}]*\).*$$|\1|g' | sort | uniq | while re= ad e; do \ - if [ -n "$$e" ]; then \ - line=3D$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=3D":")= ;\ - ((line++)) ;\ - if [ "$$line" !=3D "1" ]; then \ - translation=3D$$(head -n "$$line" "$<" | tail -1 | grep msgstr | sed 's|m= sgstr "\([^"]*\)"|\1|') ;\ - if [ "$$translation" !=3D "" ]; then \ - sed "N;s@\(p\?x\?ref\){$$(echo $$e | sed 's| |[\\n ]|g')\(,\|}\)@\1= {$$translation\2@g;P;D" -i "$@.tmp" ;\ - fi ;\ - fi ;\ - fi ;\ -done +$(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \ + "$(top_srcdir)/build-aux/convert-xref.scm" \ + $@.tmp $< endef =20 -$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contribut= ing.%.texi +$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contribut= ing.%.texi make-go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" = -l "$@.tmp" -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" =20 -$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po +$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po make-go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi"= -p "$<" -l "$@.tmp" -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|"= "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" =20 -$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po +$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po make-go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" = -p "$<" -l "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" diff --git a/guix/build/po.scm b/guix/build/po.scm index eb9690ad1a..7f88164cd8 100644 --- a/guix/build/po.scm +++ b/guix/build/po.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2019 Julien Lepiller +;;; Copyright =C2=A9 2019, 2021 Julien Lepiller ;;; Copyright =C2=A9 2020 Ludovic Court=C3=A8s ;;; ;;; This file is part of GNU Guix. @@ -20,17 +20,23 @@ (define-module (guix build po) #:use-module (ice-9 match) #:use-module (ice-9 peg) + #:use-module (ice-9 regex) #:use-module (ice-9 textual-ports) - #:export (read-po-file)) + #:use-module (ice-9 vlist) + #:use-module (srfi srfi-1) + #:export (read-po-file + translate-cross-references)) =20 ;; A small parser for po files -(define-peg-pattern po-file body (* (or comment entry whitespace))) +(define-peg-pattern po-file body (* (or entry whitespace))) (define-peg-pattern whitespace body (or " " "\t" "\n")) (define-peg-pattern comment-chr body (range #\space #\=F0=AF=A7=BF)) (define-peg-pattern comment none (and "#" (* comment-chr) "\n")) +(define-peg-pattern flags all (and (ignore "#, ") (* comment-chr) (ignore = "\n"))) (define-peg-pattern entry all - (and (ignore (* whitespace)) (ignore "msgid ") msgid - (ignore (* whitespace)) (ignore "msgstr ") msgstr)) + (and (* (or flags comment (ignore (* whitespace)))) + (ignore "msgid ") msgid (ignore (* whitespace)) + (ignore "msgstr ") msgstr)) (define-peg-pattern escape body (or "\\\\" "\\\"" "\\n")) (define-peg-pattern str-chr body (or " " "!" (and (ignore "\\") "\"") "\\n" (and (ignore "\\") "\\") @@ -53,7 +59,24 @@ (append (list "\n" prefix) result))))))) =20 (define (parse-tree->assoc parse-tree) - "Converts a po PARSE-TREE to an association list." + "Converts a po PARSE-TREE to an association list, where the key is the m= sgid +and the value is the msgstr. The result only contains non fuzzy strings." + (define (comments->flags comments) + (match comments + (('flags flags) + (map (lambda (flag) (string->symbol (string-trim-both flag #\space)= )) + (string-split flags #\,))) + ((? list? comments) + (fold + (lambda (comment res) + (match comment + ((? string? _) res) + (flags + (append (comments->flags flags) + res)))) + '() + comments)))) + (match parse-tree (() '()) ((entry . parse-tree) @@ -66,10 +89,22 @@ ;; empty msgstr (('entry ('msgid msgid) 'msgstr) (parse-tree->assoc parse-tree)) + (('entry _ ('msgid msgid) 'msgstr) + (parse-tree->assoc parse-tree)) (('entry ('msgid msgid) ('msgstr msgstr)) (acons (interpret-newline-escape msgid) (interpret-newline-escape msgstr) - (parse-tree->assoc parse-tree))))))) + (parse-tree->assoc parse-tree))) + (('entry ('msgid msgid) ('msgstr msgstr)) + (acons (interpret-newline-escape msgid) + (interpret-newline-escape msgstr) + (parse-tree->assoc parse-tree))) + (('entry comments ('msgid msgid) ('msgstr msgstr)) + (if (member 'fuzzy (comments->flags comments)) + (parse-tree->assoc parse-tree) + (acons (interpret-newline-escape msgid) + (interpret-newline-escape msgstr) + (parse-tree->assoc parse-tree)))))))) =20 (define (read-po-file port) "Read a .po file from PORT and return an alist of msgid and msgstr." @@ -77,3 +112,71 @@ po-file (get-string-all port))))) (parse-tree->assoc tree))) + +(define (canonicalize-whitespace str) + "Change whitespace (newlines, etc.) in STR to @code{#\\space}." + (string-map (lambda (chr) + (if (char-set-contains? char-set:whitespace chr) + #\space + chr)) + str)) + +(define xref-regexp + ;; Texinfo cross-reference regexp. + (make-regexp "@(px|x)?ref\\{([^,}]+)")) + +(define (translate-cross-references texi pofile) + "Translate the cross-references that appear in @var{texi}, the initial +translation of a Texinfo file, using the msgid/msgstr pairs from @var{pofi= le}." + (define translations + (call-with-input-file pofile read-po-file)) + + (define content + (call-with-input-file texi get-string-all)) + + (define matches + (list-matches xref-regexp content)) + + (define translation-map + (fold (match-lambda* + (((msgid . str) result) + (vhash-cons msgid str result))) + vlist-null + translations)) + + (define translated + ;; Iterate over MATCHES and replace cross-references with their + ;; translation found in TRANSLATION-MAP. (We can't use + ;; 'substitute*' because matches can span multiple lines.) + (let loop ((matches matches) + (offset 0) + (result '())) + (match matches + (() + (string-concatenate-reverse + (cons (string-drop content offset) result))) + ((head . tail) + (let ((prefix (match:substring head 1)) + (ref (canonicalize-whitespace (match:substring head 2)))) + (define translated + (string-append "@" (or prefix "") + "ref{" + (match (vhash-assoc ref translation-map) + (#f ref) + ((_ . str) str)))) + + (loop tail + (match:end head) + (append (list translated + (string-take + (string-drop content offset) + (- (match:start head) offset))) + result))))))) + + (format (current-error-port) + "translated ~a cross-references in '~a'~%" + (length matches) texi) + + (call-with-output-file texi + (lambda (port) + (display translated port)))) diff --git a/guix/self.scm b/guix/self.scm index 61ff423086..fc581becd4 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2017, 2018, 2019, 2020, 2021 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2020 Martin Becze +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -316,81 +317,23 @@ the result to OUTPUT." chr)) str)) =20 - (define xref-regexp - ;; Texinfo cross-reference regexp. - (make-regexp "@(px|x)?ref\\{([^,}]+)")) - - (define (translate-cross-references texi translations) - ;; Translate the cross-references that appear in TEXI, a Texin= fo - ;; file, using the msgid/msgstr pairs from TRANSLATIONS. - (define content - (call-with-input-file texi get-string-all)) - - (define matches - (list-matches xref-regexp content)) - - (define translation-map - (fold (match-lambda* - (((msgid . str) result) - (vhash-cons msgid str result))) - vlist-null - translations)) - - (define translated - ;; Iterate over MATCHES and replace cross-references with th= eir - ;; translation found in TRANSLATION-MAP. (We can't use - ;; 'substitute*' because matches can span multiple lines.) - (let loop ((matches matches) - (offset 0) - (result '())) - (match matches - (() - (string-concatenate-reverse - (cons (string-drop content offset) result))) - ((head . tail) - (let ((prefix (match:substring head 1)) - (ref (canonicalize-whitespace (match:substring= head 2)))) - (define translated - (string-append "@" (or prefix "") - "ref{" - (match (vhash-assoc ref translation-= map) - (#f ref) - ((_ . str) str)))) - - (loop tail - (match:end head) - (append (list translated - (string-take - (string-drop content offset) - (- (match:start head) offset))) - result))))))) - - (format (current-error-port) - "translated ~a cross-references in '~a'~%" - (length matches) texi) - (call-with-output-file texi - (lambda (port) - (display translated port)))) - (define* (translate-texi prefix po lang #:key (extras '())) "Translate the manual for one language LANG using the PO file. PREFIX must be the prefix of the manual, 'guix' or 'guix-cookbook'. EXTRA= S is a list of extra files, such as '(\"contributing\")." - (let ((translations (call-with-input-file po read-po-file))) - (for-each (lambda (file) - (translate-tmp-texi po (string-append file ".tex= i") - (string-append file "." lang - ".texi.tmp"))) - (cons prefix extras)) + (for-each (lambda (file) + (translate-tmp-texi po (string-append file ".texi") + (string-append file "." lang + ".texi.tmp"))) + (cons prefix extras)) =20 - (for-each (lambda (file) - (let* ((texi (string-append file "." lang ".texi= ")) - (tmp (string-append texi ".tmp"))) - (copy-file tmp texi) - (translate-cross-references texi - translations))) - (cons prefix extras)))) + (for-each (lambda (file) + (let* ((texi (string-append file "." lang ".texi")) + (tmp (string-append texi ".tmp"))) + (copy-file tmp texi) + (translate-cross-references texi po))) + (cons prefix extras))) =20 (define (available-translations directory domain) ;; Return the list of available translations under DIRECTORY f= or --=20 2.33.0 --MP_/rT0vi8_QcOgtQ61Cv5jhSxv-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 13:17:44 2021 Received: (at 51122) by debbugs.gnu.org; 11 Oct 2021 17:17:44 +0000 Received: from localhost ([127.0.0.1]:60822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZyvo-0000l5-5k for submit@debbugs.gnu.org; Mon, 11 Oct 2021 13:17:44 -0400 Received: from pelzflorian.de ([5.45.111.108]:33078 helo=mail.pelzflorian.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZyvi-0000g7-DT for 51122@debbugs.gnu.org; Mon, 11 Oct 2021 13:17:42 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 1403236069D; Mon, 11 Oct 2021 19:17:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1633972657; bh=Y+sSpwFDqupkQ4gZj6dhcznqOFfhtBaUuOROKtcJZLw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Ry+CGe6s3D/KIcUWlCyN9zkqb+eqPBs7Q2aaRNykHXfZW1Fn+UNHx+thqXIQWIhQy 7ZkSWXGgm33P2B2NlWW41b7j+Buyy2yzYraVCQpXVh6jDw0TyXIbxUdxs0ks4vuRXj kJ79d+RduTlikR26ws0YnqqEUvIFthWx7IF6iEYE= Date: Mon, 11 Oct 2021 19:17:28 +0200 From: "pelzflorian (Florian Pelz)" To: Julien Lepiller Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211011144626.0049af43@tachikoma.lepiller.eu> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks Julien! On Mon, Oct 11, 2021 at 02:46:26PM +0200, Julien Lepiller wrote: > Thanks for the quick review! I've updated the commit message and > updated the copyright headers in guix/build/po.scm and guix/self.scm. In guix/self.scm you only removed code. I don’t think a copyright header is needed there. > I had to make the texi files depend on make-go because otherwise, I get > messages like "guix/build/po.scm is newer than compiled > .../guix/build/po.go" and it takes forever to build that file, once for > each texi. For some reason, it's almost instantaneous when building in > make-go. make-core-go instead of make-go is enough in my testing, but something more fine-grained would save time. Also POXREF is run twice for each guix.??.texi file. Maybe I did something wrong, maybe it is your patch. Not sure. Testing takes long anyway. Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 18:07:10 2021 Received: (at 51122) by debbugs.gnu.org; 11 Oct 2021 22:07:10 +0000 Received: from localhost ([127.0.0.1]:32958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ma3Rt-000290-SO for submit@debbugs.gnu.org; Mon, 11 Oct 2021 18:07:10 -0400 Received: from lepiller.eu ([89.234.186.109]:35338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ma3Rq-00028o-B2 for 51122@debbugs.gnu.org; Mon, 11 Oct 2021 18:07:08 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 7dba6dac; Mon, 11 Oct 2021 22:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=DeMwlJctWCW4 HUJjLaYjCmI6TgKWq/376wmDFCKj+Lc=; b=Py1MZY8kcI5OnfdO/deSYGoNylx0 MUId2X+EsssBSpdq3JicDrqaKYbEwdxZydT2OsDilrtKQ1qsIYyDtIe3+5nVuBWU 2o56z9SNElNUfuRvUJIf/8wyyeXHWZsD8HILI83BweSWO0n2tzy9uDQ/ucj3qmZQ mRqnjWywEt4osNIxRx/a5thDnBctlsQ2/s3AMJmrRgxHqQW2CLQsvX81uC1r2kvN pFTzFLr4YIsQPje8K7MvGEB3uAYXEMqDwH7D9Iz+OFgg4nL45PqaiyO6ajMJvh+3 Oeq6kvM+DsYbzOHYAV+qhZWculQRJN+qEzXZ5kMMSSVFLqtwThGcxFQt0w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 67d722c0 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 11 Oct 2021 22:07:03 +0000 (UTC) Date: Tue, 12 Oct 2021 00:06:57 +0200 From: Julien Lepiller To: "pelzflorian (Florian Pelz)" Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211012000657.11daa7a3@tachikoma.lepiller.eu> In-Reply-To: <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Mon, 11 Oct 2021 19:17:28 +0200, "pelzflorian (Florian Pelz)" a =C3=A9crit : > Thanks Julien! >=20 > On Mon, Oct 11, 2021 at 02:46:26PM +0200, Julien Lepiller wrote: > > Thanks for the quick review! I've updated the commit message and > > updated the copyright headers in guix/build/po.scm and > > guix/self.scm. =20 >=20 > In guix/self.scm you only removed code. I don=E2=80=99t think a copyright > header is needed there. Alright, I removed the copyright line on my side =20 >=20 > > I had to make the texi files depend on make-go because otherwise, I > > get messages like "guix/build/po.scm is newer than compiled > > .../guix/build/po.go" and it takes forever to build that file, once > > for each texi. For some reason, it's almost instantaneous when > > building in make-go. =20 >=20 > make-core-go instead of make-go is enough in my testing, but something > more fine-grained would save time. Also POXREF is run twice for each > guix.??.texi file. Maybe I did something wrong, maybe it is your > patch. Not sure. Testing takes long anyway. It only runs it once here, but there are three files to translate: guix.xx.texi, guix-cookbook.xx.texi and contributing.xx.texi. It looks like depending on make-go or make-core-go means we rebuild the texi files everytime we run "make", so that's not great :/. I'll see if I can isolate guix/build/po.scm (any ideas?). > Regards, > Florian From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 12 11:56:29 2021 Received: (at 51122) by debbugs.gnu.org; 12 Oct 2021 15:56:29 +0000 Received: from localhost ([127.0.0.1]:49950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maK8j-0002OO-A3 for submit@debbugs.gnu.org; Tue, 12 Oct 2021 11:56:29 -0400 Received: from pelzflorian.de ([5.45.111.108]:34350 helo=mail.pelzflorian.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maK8f-0002Nj-3e for 51122@debbugs.gnu.org; Tue, 12 Oct 2021 11:56:26 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 9B0DF36069D; Tue, 12 Oct 2021 17:56:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1634054183; bh=m3uKSkemHoliD6oJwNh/bD/xwVghudLLvkMCYHasgNg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=B7mBtayKAJMpl+FaSPCSNf2uPke17X7IE7j4CS/rx0HasVMXDGKhnyuEaue1fOv5/ MKECnQpTr2TzeWdr8XlzvcUPEAz0w6fbGyWcds32jrny3anC649FP8ac/RLamAeKU6 c4ImdZ4mICwdzHGNffTdQuw87nZKJSbeCW6HgUzQ= Date: Tue, 12 Oct 2021 17:56:11 +0200 From: "pelzflorian (Florian Pelz)" To: Julien Lepiller Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> <20211012000657.11daa7a3@tachikoma.lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211012000657.11daa7a3@tachikoma.lepiller.eu> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Oct 12, 2021 at 12:06:57AM +0200, Julien Lepiller wrote: > Le Mon, 11 Oct 2021 19:17:28 +0200, > "pelzflorian (Florian Pelz)" a écrit : > > Also POXREF is run twice for each > > guix.??.texi file. Maybe I did something wrong, maybe it is your > > patch. Not sure. Testing takes long anyway. > It only runs it once here, but there are three files to translate: > guix.xx.texi, guix-cookbook.xx.texi and contributing.xx.texi. At least when depending on make-core-go instead of make-go, it does POXREF each file twice, in between printing “Updating doc/version.texi”. Anyway, this is more important: > It looks like depending on make-go or make-core-go means we rebuild the > texi files everytime we run "make", so that's not great :/. We definitely want to compile guix/build/po.scm, I think, because it should be run each time a guix-manual.LL.po or guix-cookbook.LL.po file changes. GNU Make manual says : > A phony target should not be a prerequisite of a real target file; if > it is, its recipe will be run every time make goes to update that > file. But Makefile.am defines guile-compilation-rule to create a Phony target. This is bad for us because likely there should not be duplicate code to compile guix/build/po.scm and to compile the rest. So I presume part of guile-compilation-rule must be split off? Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 12 14:09:55 2021 Received: (at 51122) by debbugs.gnu.org; 12 Oct 2021 18:09:55 +0000 Received: from localhost ([127.0.0.1]:53000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maMDr-0004NT-4U for submit@debbugs.gnu.org; Tue, 12 Oct 2021 14:09:55 -0400 Received: from pelzflorian.de ([5.45.111.108]:34470 helo=mail.pelzflorian.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maMDp-0004NF-90 for 51122@debbugs.gnu.org; Tue, 12 Oct 2021 14:09:54 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 98D5D36069D; Tue, 12 Oct 2021 20:09:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1634062191; bh=cE0IX1rfMbyRKrtkyhYkIiOMfnWKEE/rfUDQ/Dvf2Fs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=3z7/f+bkYBmCGu51wnDIhfn9pHLK2GkOpZKr8/GP61euwMIKzCD2GRSPAv6wKgj9p tx9Bk26FLHZN/waCn/AnMD5TngF38EkO8FBBL6ebfcYFxAy3+fH7JCEbpwDn0cWJcQ n9D0QduPbPKK3bJ7Md5MXj+TyZ4AOKulEuVMhWyM= Date: Tue, 12 Oct 2021 20:09:41 +0200 From: "pelzflorian (Florian Pelz)" To: Julien Lepiller Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211012180941.i7c26gyz3yyqsdd6@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> <20211012000657.11daa7a3@tachikoma.lepiller.eu> <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Oct 12, 2021 at 05:56:23PM +0200, pelzflorian (Florian Pelz) wrote: > We definitely want to compile guix/build/po.scm, I think, because it > should be run each time a guix-manual.LL.po or guix-cookbook.LL.po > file changes. Then again, is calling guix without compiling necessarily slower than the sed script? Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 12 15:25:54 2021 Received: (at 51122) by debbugs.gnu.org; 12 Oct 2021 19:25:54 +0000 Received: from localhost ([127.0.0.1]:53791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maNPO-00072I-KI for submit@debbugs.gnu.org; Tue, 12 Oct 2021 15:25:54 -0400 Received: from lepiller.eu ([89.234.186.109]:35386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maNPL-000726-Nq for 51122@debbugs.gnu.org; Tue, 12 Oct 2021 15:25:53 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id b03b40e4; Tue, 12 Oct 2021 19:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=WTnYs0c+/X3Y H/tG/OjAbe20pVfJl34K0qVq3yunsdM=; b=jO40YjtdPVxHBS10Kt5pkMKSjcDS Rel+KEhYc/GpTtO2L6wfLl+cv5adyriCAbpqKyZchbshMbBFM3AWwEfU8WpGuWFd LRkmQDvx6heWxhfzKXDG7ynXag/3qpc20WwW4Y1rwAQFibjPwcDcsNwsNFsA5YGs vRRAp0y1jAXTCfVuWOHiAd0alP/nPi/IrcuEJXdUpJm8plFqx4XNarRh/+maC/Os L4PtJbXTutZ5O9fxeFhXv/Ha1ab5oY9RUdqvTuyhBRL2r5SDDmq0zXn/aH/e8192 nK+GPsVKxYodnGEXT5wooUmJTAbJOck4RJNSvKkIciKd1bx7cleqyiRzog== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 7186af30 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 12 Oct 2021 19:25:48 +0000 (UTC) Date: Tue, 12 Oct 2021 15:25:37 -0400 From: Julien Lepiller To: "pelzflorian (Florian Pelz)" Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. User-Agent: K-9 Mail for Android In-Reply-To: <20211012180941.i7c26gyz3yyqsdd6@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> <20211012000657.11daa7a3@tachikoma.lepiller.eu> <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> <20211012180941.i7c26gyz3yyqsdd6@pelzflorian.localdomain> Message-ID: <5EFA87E6-D0D0-4D28-99D4-2CCC7E00EDD0@lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le 12 octobre 2021 14:09:41 GMT-04:00, "pelzflorian (Florian Pelz)" a =C3=A9crit=C2=A0: >On Tue, Oct 12, 2021 at 05:56:23PM +0200, pelzflorian (Florian Pelz) wrot= e: >> We definitely want to compile guix/build/po=2Escm, I think, because it >> should be run each time a guix-manual=2ELL=2Epo or guix-cookbook=2ELL= =2Epo >> file changes=2E > >Then again, is calling guix without compiling necessarily slower than >the sed script? > >Regards, >Florian Yes, each time I see the "newer than compiled" message, it takes several m= inutes=2E From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 15 22:12:32 2021 Received: (at 51122) by debbugs.gnu.org; 16 Oct 2021 02:12:32 +0000 Received: from localhost ([127.0.0.1]:40655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbZBX-0004XR-3G for submit@debbugs.gnu.org; Fri, 15 Oct 2021 22:12:31 -0400 Received: from lepiller.eu ([89.234.186.109]:35678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbZBQ-0004XC-6E for 51122@debbugs.gnu.org; Fri, 15 Oct 2021 22:12:29 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 5359caf1; Sat, 16 Oct 2021 02:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=YEL7kLudPtGHs60Uji4dghidy5zBOndrknHwfu GFNHI=; b=L3zXFHHudMKxrnxaz89fzWTXGpV6KH9vlwlxxCoERaPezmtQ09J1SN W+xbq2BQ1TrXX4UD2cp677nenlz0XN1eWvY2RqfYSsXM58F4AsW3tr8wkTVHngz0 v8r1/PnTMbn4A5Dhs1ht9WlLBp+kJsqzPvoWRY2SIVJ7y86bUK/KI8uJrbF8QawE PZX73e/hZZ4ROkDzIgKDp1ZEycChPuMIJSheAejtHnSBgQfFWzgtAHXnbm1xzYmz g0W/6tBrqUrpZY8+qj0qpwwz8Dc3eWj8/2h0jvhA8jlDBHtXO4C3li3dRJM+M1yM hogHbLBZ4wLAFkojb3NoOwcAAvCfGuRw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 203293d6 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 16 Oct 2021 02:12:22 +0000 (UTC) Date: Sat, 16 Oct 2021 04:12:15 +0200 From: Julien Lepiller To: "pelzflorian (Florian Pelz)" Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211016041215.1005a12b@tachikoma.lepiller.eu> In-Reply-To: <5EFA87E6-D0D0-4D28-99D4-2CCC7E00EDD0@lepiller.eu> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> <20211012000657.11daa7a3@tachikoma.lepiller.eu> <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> <20211012180941.i7c26gyz3yyqsdd6@pelzflorian.localdomain> <5EFA87E6-D0D0-4D28-99D4-2CCC7E00EDD0@lepiller.eu> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/9VvQuUbQh/xngZ4vfRMsCRY" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/9VvQuUbQh/xngZ4vfRMsCRY Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Tue, 12 Oct 2021 15:25:37 -0400, Julien Lepiller a =C3=A9crit : > Le 12 octobre 2021 14:09:41 GMT-04:00, "pelzflorian (Florian Pelz)" > a =C3=A9crit=C2=A0: > >On Tue, Oct 12, 2021 at 05:56:23PM +0200, pelzflorian (Florian Pelz) > >wrote: =20 > >> We definitely want to compile guix/build/po.scm, I think, because > >> it should be run each time a guix-manual.LL.po or > >> guix-cookbook.LL.po file changes. =20 > > > >Then again, is calling guix without compiling necessarily slower than > >the sed script? > > > >Regards, > >Florian =20 >=20 > Yes, each time I see the "newer than compiled" message, it takes > several minutes. >=20 >=20 >=20 I managed to change the dependency to only guix/po.go, and to make it not phony, so the translated manuals don't get rebuilt on every make invocation anymore. I checked again that "make" from a clean checkout and "make as-derivation" still work. --MP_/9VvQuUbQh/xngZ4vfRMsCRY Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-maint-Factorize-po-xref-translation.patch =46rom 96d7096ac46f0fa8a97db76fefdf751a0584975b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sun, 10 Oct 2021 22:07:51 +0200 Subject: [PATCH] maint: Factorize po xref translation. This ensures we use the same method in "make" as in "guix/self.scm". * Makefile.am: Build guix/build/po.scm. * build-aux/convert-xref.scm: New file. * doc/local.mk (xref_command): Use it. * guix/self.scm (translate-cross-references): Move it... * guix/build/po.scm: Parse comments and flags separately to find fuzzy flags. (translate-cross-references): ...here. (parse-tree->assoc): Ignore fuzzy entries. --- Makefile.am | 12 +++- build-aux/convert-xref.scm | 26 +++++++++ doc/local.mk | 29 +++------- guix/build/po.scm | 115 +++++++++++++++++++++++++++++++++++-- guix/self.scm | 81 ++++---------------------- 5 files changed, 164 insertions(+), 99 deletions(-) create mode 100644 build-aux/convert-xref.scm diff --git a/Makefile.am b/Makefile.am index 635147efc1..41ec19eb89 100644 --- a/Makefile.am +++ b/Makefile.am @@ -640,6 +640,7 @@ EXTRA_DIST +=3D \ build-aux/check-final-inputs-self-contained.scm \ build-aux/check-channel-news.scm \ build-aux/compile-as-derivation.scm \ + build-aux/convert-xref.scm \ build-aux/generate-authors.scm \ build-aux/test-driver.scm \ build-aux/update-guix-package.scm \ @@ -699,8 +700,6 @@ $(1): $(2) --completed $(3) \ $$(filter %.scm,$$^) =20 -.PHONY: $(1) - endef =20 # Split compilation in several steps, each of which building a subset of @@ -712,22 +711,31 @@ MODULES_CORE =3D guix.scm $(filter-out guix/scrip= ts/%,$(filter guix/%,$(MODULE MODULES_PACKAGES =3D $(filter gnu/packages/%,$(MODULES)) MODULES_SYSTEM =3D gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(= MODULES))) MODULES_CLI =3D $(filter guix/scripts/%,$(MODULES)) +MODULES_PO =3D guix/build/po.scm =20 $(eval $(call guile-compilation-rule,make-core-go, \ $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \ 0)) +.PHONY: make-core-go =20 $(eval $(call guile-compilation-rule,make-packages-go, \ $(MODULES_PACKAGES) make-core-go, \ $(words $(MODULES_CORE)))) +.PHONY: make-packages-go =20 $(eval $(call guile-compilation-rule,make-system-go, \ $(MODULES_SYSTEM) make-packages-go make-core-go, \ $(words $(MODULES_CORE) $(MODULES_PACKAGES)))) +.PHONY: make-system-go =20 $(eval $(call guile-compilation-rule,make-cli-go, \ $(MODULES_CLI) make-system-go make-packages-go make-core-go, \ $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM)))) +.PHONY: make-cli-go + +$(eval $(call guile-compilation-rule,guix/build/po.go, \ + $(MODULES_PO), \ + 0)) =20 SUFFIXES =3D .go =20 diff --git a/build-aux/convert-xref.scm b/build-aux/convert-xref.scm new file mode 100644 index 0000000000..47c8828857 --- /dev/null +++ b/build-aux/convert-xref.scm @@ -0,0 +1,26 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Julien Lepiller +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +;; Translate cross-references in a translated .texi manual. + +(use-modules (guix build po) + (ice-9 match)) + +(match (command-line) + ((program texi pofile) + (translate-cross-references texi pofile))) diff --git a/doc/local.mk b/doc/local.mk index 8340b75a87..fff11f8183 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -97,44 +97,29 @@ PO4A_PARAMS +=3D -k 0 # produce an output even if the t= ranslation is not complete PO4A_PARAMS +=3D -f texinfo # texinfo format =20 # When a change to guix.texi occurs, it is not translated immediately. -# Because @pxref and @xref commands are reference to a section by name, th= ey +# Because @pxref and @xref commands are references to sections by name, th= ey # should be translated. If a modification adds a reference to a section, t= his # reference is not translated, which means it references a section that do= es not # exist. -# This command loops through the translated files looking for references. = For -# each of these references, it tries to find the translation and replaces = the -# reference name, even in untranslated strings. -# The last sed is a multiline sed because some references span multiple li= nes. define xref_command -cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g= ' | \ - tr -d '\012' | sed 's|\(@p\?x\?ref\)|\n\1|g' | egrep '@p?x?ref' | \ - sed 's|^.*@p\?x\?ref{\([^,}]*\).*$$|\1|g' | sort | uniq | while re= ad e; do \ - if [ -n "$$e" ]; then \ - line=3D$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=3D":")= ;\ - ((line++)) ;\ - if [ "$$line" !=3D "1" ]; then \ - translation=3D$$(head -n "$$line" "$<" | tail -1 | grep msgstr | sed 's|m= sgstr "\([^"]*\)"|\1|') ;\ - if [ "$$translation" !=3D "" ]; then \ - sed "N;s@\(p\?x\?ref\){$$(echo $$e | sed 's| |[\\n ]|g')\(,\|}\)@\1= {$$translation\2@g;P;D" -i "$@.tmp" ;\ - fi ;\ - fi ;\ - fi ;\ -done +$(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \ + "$(top_srcdir)/build-aux/convert-xref.scm" \ + $@.tmp $< endef =20 -$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contribut= ing.%.texi +$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contribut= ing.%.texi guix/build/po.go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" = -l "$@.tmp" -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" =20 -$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po +$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/p= o.go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi"= -p "$<" -l "$@.tmp" -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|"= "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" =20 -$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po +$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" = -p "$<" -l "$@.tmp" -$(AM_V_POXREF)$(xref_command) -mv "$@.tmp" "$@" diff --git a/guix/build/po.scm b/guix/build/po.scm index eb9690ad1a..a167252244 100644 --- a/guix/build/po.scm +++ b/guix/build/po.scm @@ -20,17 +20,23 @@ (define-module (guix build po) #:use-module (ice-9 match) #:use-module (ice-9 peg) + #:use-module (ice-9 regex) #:use-module (ice-9 textual-ports) - #:export (read-po-file)) + #:use-module (ice-9 vlist) + #:use-module (srfi srfi-1) + #:export (read-po-file + translate-cross-references)) =20 ;; A small parser for po files -(define-peg-pattern po-file body (* (or comment entry whitespace))) +(define-peg-pattern po-file body (* (or entry whitespace))) (define-peg-pattern whitespace body (or " " "\t" "\n")) (define-peg-pattern comment-chr body (range #\space #\=F0=AF=A7=BF)) (define-peg-pattern comment none (and "#" (* comment-chr) "\n")) +(define-peg-pattern flags all (and (ignore "#, ") (* comment-chr) (ignore = "\n"))) (define-peg-pattern entry all - (and (ignore (* whitespace)) (ignore "msgid ") msgid - (ignore (* whitespace)) (ignore "msgstr ") msgstr)) + (and (* (or flags comment (ignore (* whitespace)))) + (ignore "msgid ") msgid (ignore (* whitespace)) + (ignore "msgstr ") msgstr)) (define-peg-pattern escape body (or "\\\\" "\\\"" "\\n")) (define-peg-pattern str-chr body (or " " "!" (and (ignore "\\") "\"") "\\n" (and (ignore "\\") "\\") @@ -53,7 +59,24 @@ (append (list "\n" prefix) result))))))) =20 (define (parse-tree->assoc parse-tree) - "Converts a po PARSE-TREE to an association list." + "Converts a po PARSE-TREE to an association list, where the key is the m= sgid +and the value is the msgstr. The result only contains non fuzzy strings." + (define (comments->flags comments) + (match comments + (('flags flags) + (map (lambda (flag) (string->symbol (string-trim-both flag #\space)= )) + (string-split flags #\,))) + ((? list? comments) + (fold + (lambda (comment res) + (match comment + ((? string? _) res) + (flags + (append (comments->flags flags) + res)))) + '() + comments)))) + (match parse-tree (() '()) ((entry . parse-tree) @@ -66,10 +89,22 @@ ;; empty msgstr (('entry ('msgid msgid) 'msgstr) (parse-tree->assoc parse-tree)) + (('entry _ ('msgid msgid) 'msgstr) + (parse-tree->assoc parse-tree)) (('entry ('msgid msgid) ('msgstr msgstr)) (acons (interpret-newline-escape msgid) (interpret-newline-escape msgstr) - (parse-tree->assoc parse-tree))))))) + (parse-tree->assoc parse-tree))) + (('entry ('msgid msgid) ('msgstr msgstr)) + (acons (interpret-newline-escape msgid) + (interpret-newline-escape msgstr) + (parse-tree->assoc parse-tree))) + (('entry comments ('msgid msgid) ('msgstr msgstr)) + (if (member 'fuzzy (comments->flags comments)) + (parse-tree->assoc parse-tree) + (acons (interpret-newline-escape msgid) + (interpret-newline-escape msgstr) + (parse-tree->assoc parse-tree)))))))) =20 (define (read-po-file port) "Read a .po file from PORT and return an alist of msgid and msgstr." @@ -77,3 +112,71 @@ po-file (get-string-all port))))) (parse-tree->assoc tree))) + +(define (canonicalize-whitespace str) + "Change whitespace (newlines, etc.) in STR to @code{#\\space}." + (string-map (lambda (chr) + (if (char-set-contains? char-set:whitespace chr) + #\space + chr)) + str)) + +(define xref-regexp + ;; Texinfo cross-reference regexp. + (make-regexp "@(px|x)?ref\\{([^,}]+)")) + +(define (translate-cross-references texi pofile) + "Translate the cross-references that appear in @var{texi}, the initial +translation of a Texinfo file, using the msgid/msgstr pairs from @var{pofi= le}." + (define translations + (call-with-input-file pofile read-po-file)) + + (define content + (call-with-input-file texi get-string-all)) + + (define matches + (list-matches xref-regexp content)) + + (define translation-map + (fold (match-lambda* + (((msgid . str) result) + (vhash-cons msgid str result))) + vlist-null + translations)) + + (define translated + ;; Iterate over MATCHES and replace cross-references with their + ;; translation found in TRANSLATION-MAP. (We can't use + ;; 'substitute*' because matches can span multiple lines.) + (let loop ((matches matches) + (offset 0) + (result '())) + (match matches + (() + (string-concatenate-reverse + (cons (string-drop content offset) result))) + ((head . tail) + (let ((prefix (match:substring head 1)) + (ref (canonicalize-whitespace (match:substring head 2)))) + (define translated + (string-append "@" (or prefix "") + "ref{" + (match (vhash-assoc ref translation-map) + (#f ref) + ((_ . str) str)))) + + (loop tail + (match:end head) + (append (list translated + (string-take + (string-drop content offset) + (- (match:start head) offset))) + result))))))) + + (format (current-error-port) + "translated ~a cross-references in '~a'~%" + (length matches) texi) + + (call-with-output-file texi + (lambda (port) + (display translated port)))) diff --git a/guix/self.scm b/guix/self.scm index a0d448742a..8ada1d85a4 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2017, 2018, 2019, 2020, 2021 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2020 Martin Becze +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -316,81 +317,23 @@ the result to OUTPUT." chr)) str)) =20 - (define xref-regexp - ;; Texinfo cross-reference regexp. - (make-regexp "@(px|x)?ref\\{([^,}]+)")) - - (define (translate-cross-references texi translations) - ;; Translate the cross-references that appear in TEXI, a Texin= fo - ;; file, using the msgid/msgstr pairs from TRANSLATIONS. - (define content - (call-with-input-file texi get-string-all)) - - (define matches - (list-matches xref-regexp content)) - - (define translation-map - (fold (match-lambda* - (((msgid . str) result) - (vhash-cons msgid str result))) - vlist-null - translations)) - - (define translated - ;; Iterate over MATCHES and replace cross-references with th= eir - ;; translation found in TRANSLATION-MAP. (We can't use - ;; 'substitute*' because matches can span multiple lines.) - (let loop ((matches matches) - (offset 0) - (result '())) - (match matches - (() - (string-concatenate-reverse - (cons (string-drop content offset) result))) - ((head . tail) - (let ((prefix (match:substring head 1)) - (ref (canonicalize-whitespace (match:substring= head 2)))) - (define translated - (string-append "@" (or prefix "") - "ref{" - (match (vhash-assoc ref translation-= map) - (#f ref) - ((_ . str) str)))) - - (loop tail - (match:end head) - (append (list translated - (string-take - (string-drop content offset) - (- (match:start head) offset))) - result))))))) - - (format (current-error-port) - "translated ~a cross-references in '~a'~%" - (length matches) texi) - (call-with-output-file texi - (lambda (port) - (display translated port)))) - (define* (translate-texi prefix po lang #:key (extras '())) "Translate the manual for one language LANG using the PO file. PREFIX must be the prefix of the manual, 'guix' or 'guix-cookbook'. EXTRA= S is a list of extra files, such as '(\"contributing\")." - (let ((translations (call-with-input-file po read-po-file))) - (for-each (lambda (file) - (translate-tmp-texi po (string-append file ".tex= i") - (string-append file "." lang - ".texi.tmp"))) - (cons prefix extras)) + (for-each (lambda (file) + (translate-tmp-texi po (string-append file ".texi") + (string-append file "." lang + ".texi.tmp"))) + (cons prefix extras)) =20 - (for-each (lambda (file) - (let* ((texi (string-append file "." lang ".texi= ")) - (tmp (string-append texi ".tmp"))) - (copy-file tmp texi) - (translate-cross-references texi - translations))) - (cons prefix extras)))) + (for-each (lambda (file) + (let* ((texi (string-append file "." lang ".texi")) + (tmp (string-append texi ".tmp"))) + (copy-file tmp texi) + (translate-cross-references texi po))) + (cons prefix extras))) =20 (define (available-translations directory domain) ;; Return the list of available translations under DIRECTORY f= or --=20 2.31.1 --MP_/9VvQuUbQh/xngZ4vfRMsCRY-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 14:45:24 2021 Received: (at 51122) by debbugs.gnu.org; 16 Oct 2021 18:45:24 +0000 Received: from localhost ([127.0.0.1]:43048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbogH-0004wf-80 for submit@debbugs.gnu.org; Sat, 16 Oct 2021 14:45:24 -0400 Received: from pelzflorian.de ([5.45.111.108]:42094 helo=mail.pelzflorian.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbogE-0004wW-Dn for 51122@debbugs.gnu.org; Sat, 16 Oct 2021 14:45:15 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 33B733606A0; Sat, 16 Oct 2021 20:45:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1634409913; bh=mEVzMcjQZKh4ibAAxRjlQSATCt0oVvh+fUyY/QDTEiM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=s+hXImeZzvE28UZWlMSkeN7W2Zf93H95VbNx5Wt0iKTGi4aFDjUFdLqARAh5v4Haw J9MqOlWVm76jafjcasV+OSIEseZN+gHIp13mw9n/pGFWBwoqT1seyHpT20miCYcZtb gw/kgRFnOd3DiaU5TZIXsJ7iZh36crxjpgmxbCuI= Date: Sat, 16 Oct 2021 20:45:02 +0200 From: "pelzflorian (Florian Pelz)" To: Julien Lepiller Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211016184502.x3gxejejudogx5l5@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> <20211012000657.11daa7a3@tachikoma.lepiller.eu> <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> <20211012180941.i7c26gyz3yyqsdd6@pelzflorian.localdomain> <5EFA87E6-D0D0-4D28-99D4-2CCC7E00EDD0@lepiller.eu> <20211016041215.1005a12b@tachikoma.lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211016041215.1005a12b@tachikoma.lepiller.eu> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51122 Cc: 51122@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, Oct 16, 2021 at 04:12:15AM +0200, Julien Lepiller wrote: > I managed to change the dependency to only guix/po.go, and to make it > not phony, so the translated manuals don't get rebuilt on every make > invocation anymore. I checked again that "make" from a clean checkout > and "make as-derivation" still work. Good, thank you! I had thought it would be more complicated than moving out the PHONY directive, but all works OK: Without patch, the fuzzy references cause make to fail for Weblate’s version of the Spanish manual. With patch, make runs through fine as you write. GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes make update-guix-package && git commit and guix pull and still works, guix build guix failed in check but for unrelated reasons, so the patch LGTM. Except: As we discussed before, you only remove code from guix/self.scm, so you should not add a copyright line. Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 17 16:12:46 2021 Received: (at 51122-done) by debbugs.gnu.org; 17 Oct 2021 20:12:46 +0000 Received: from localhost ([127.0.0.1]:45305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcCWU-000522-FI for submit@debbugs.gnu.org; Sun, 17 Oct 2021 16:12:46 -0400 Received: from lepiller.eu ([89.234.186.109]:35910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcCWO-00051o-Tb for 51122-done@debbugs.gnu.org; Sun, 17 Oct 2021 16:12:44 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id f9c3778b; Sun, 17 Oct 2021 20:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=bI+Y/1heO1xM OHHMo3gM9CSfbqadAW/XLtTTIlwuYpU=; b=VInGvWZosKZ+gkfHszFVBUEObMVF oJFFenYtDJx1nzPh2RCiF7wmKW8AttnbQDsEyHDERYh3tlvWhkpvsAoGZ4OUKYyp 8OBZHX+Fa9m5fs3/VKYRyn7xEgUSHa5su0gGR4f2wMWOTgP8Avwa0nisCqbvTLb6 qfTC8pyFX4sh7clQLeu0wCvB3pwf2JLl45f0G5m+92GFgIdMKSqyt8EGWFUIL43I FWH2CmRg9l2qiNO/lMvYf7Dku0M/oXFKzkA+KnptmFDU7NJfmiaqFiAFuf+ALBZ8 OAXcRqn6kcZmcit6yXpTy81FRfJuwaehV+n1ejNRp/0KKG6/9/dNjpIkLg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 1ede9dc7 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sun, 17 Oct 2021 20:12:36 +0000 (UTC) Date: Sun, 17 Oct 2021 22:12:29 +0200 From: Julien Lepiller To: "pelzflorian (Florian Pelz)" Subject: Re: [bug#51122] [PATCH v2] maint: Factorize po xref translation. Message-ID: <20211017221229.071626be@tachikoma.lepiller.eu> In-Reply-To: <20211016184502.x3gxejejudogx5l5@pelzflorian.localdomain> References: <8a210e8ceaadfa600e60b0b97a1e7aba04b2bb02.1633901513.git.julien@lepiller.eu> <20211010233711.23bb1e9e@tachikoma.lepiller.eu> <20211011082415.j6wera4b5t4mtnxa@pelzflorian.localdomain> <20211011144626.0049af43@tachikoma.lepiller.eu> <20211011171603.3m7spi6bwlhpgjiv@pelzflorian.localdomain> <20211012000657.11daa7a3@tachikoma.lepiller.eu> <20211012155611.vbhkyxjmqlc3ja77@pelzflorian.localdomain> <20211012180941.i7c26gyz3yyqsdd6@pelzflorian.localdomain> <5EFA87E6-D0D0-4D28-99D4-2CCC7E00EDD0@lepiller.eu> <20211016041215.1005a12b@tachikoma.lepiller.eu> <20211016184502.x3gxejejudogx5l5@pelzflorian.localdomain> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51122-done Cc: 51122-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Sat, 16 Oct 2021 20:45:02 +0200, "pelzflorian (Florian Pelz)" a =C3=A9crit : > On Sat, Oct 16, 2021 at 04:12:15AM +0200, Julien Lepiller wrote: > > I managed to change the dependency to only guix/po.go, and to make > > it not phony, so the translated manuals don't get rebuilt on every > > make invocation anymore. I checked again that "make" from a clean > > checkout and "make as-derivation" still work. =20 >=20 > Good, thank you! I had thought it would be more complicated than > moving out the PHONY directive, but all works OK: >=20 > Without patch, the fuzzy references cause make to fail for Weblate=E2=80= =99s > version of the Spanish manual. With patch, make runs through fine as > you write. GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=3Dyes make > update-guix-package && git commit and guix pull and still works, guix > build guix failed in check but for unrelated reasons, so the patch > LGTM. Except: >=20 > As we discussed before, you only remove code from guix/self.scm, so > you should not add a copyright line. >=20 > Regards, > Florian Thanks, pushed as 0623138ffa5b066afc25547ffdeb97753cb0ee9a, and followed by an nls update. From unknown Fri Jun 20 18:18:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 15 Nov 2021 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator