From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OPBTM1JhjGAVZAAAgWs5BA (envelope-from ) for ; Fri, 30 Apr 2021 21:58:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id g1kDL1JhjGBBLgAAB5/wlQ (envelope-from ) for ; Fri, 30 Apr 2021 19:58:10 +0000 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 7C60C25329 for ; Fri, 30 Apr 2021 21:58:10 +0200 (CEST) Received: from localhost ([::1]:35916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcZH7-0007c1-Gr for larch@yhetil.org; Fri, 30 Apr 2021 15:58:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcZH0-0007aO-Kr for guix-patches@gnu.org; Fri, 30 Apr 2021 15:58:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48333) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcZH0-0005Vd-D7 for guix-patches@gnu.org; Fri, 30 Apr 2021 15:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lcZH0-0000lh-BY for guix-patches@gnu.org; Fri, 30 Apr 2021 15:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47882] [PATCH] Makefile: Reimplement download-po target Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 30 Apr 2021 19:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47882 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 47882@debbugs.gnu.org Received: via spool by 47882-submit@debbugs.gnu.org id=B47882.16198126362885 (code B ref 47882); Fri, 30 Apr 2021 19:58:02 +0000 Received: (at 47882) by debbugs.gnu.org; 30 Apr 2021 19:57:16 +0000 Received: from localhost ([127.0.0.1]:59879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcZGG-0000kS-DG for submit@debbugs.gnu.org; Fri, 30 Apr 2021 15:57:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcZGE-0000kE-Qo for 47882@debbugs.gnu.org; Fri, 30 Apr 2021 15:57:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55779) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcZG8-00051t-N9; Fri, 30 Apr 2021 15:57:08 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41214 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lcZG8-0005S8-6F; Fri, 30 Apr 2021 15:57:08 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210419000958.49968055@tachikoma.lepiller.eu> Date: Fri, 30 Apr 2021 21:57:05 +0200 In-Reply-To: <20210419000958.49968055@tachikoma.lepiller.eu> (Julien Lepiller's message of "Mon, 19 Apr 2021 00:09:58 +0200") Message-ID: <87im43a6lq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619812690; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=/5aiVSpfyY7vbYitLLwVzIzwV8lw2sMLR0Np/cjOD7I=; b=rODPNoT26H+WBNjtxVE2VKp/5fqfJmOPhnJ5U4KZcM0rAqZk+7JPgBS/s3ViLZFQLl17S7 fIxTxAR7seBZz23ooIkXqhCxPlh+ISkJZpcmLXc5Hdvp17dn4ASAM4V3l8K2JFqHY+jxVz 7nKYH1ovp6h/oSGwsewVxlmOmUXjOIGqmPrmdQmf+xUK3GdhagxJYkuMG85r4hCbxdMPD2 J2qKVZezsLNKbgFDBMEkOdD8infcyPFNGMbJqFUxGz2vjOwSRnjMxuCLdc9DlV6mNfShTv f+eS/S8mUHtsa9J6385CE7Ugw2nm0bF6nv7uvgDcvoB+rqStBJqEqAzDUDX+eg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619812690; a=rsa-sha256; cv=none; b=ipN7PlGMuUDruqSpayCanOKv6vY4pC9bm3xpG/GCxUVnLQH+t9R4sQZ+ofg5smtYrOvw41 2kDswCLPordJmplI6it7kQyLsjLBgex1GUV+Mqp1NWAu05ALe1sAr+tI7WlC+dxTOhldSn geGq+GBhKrUqjMyP/q7Yrd0vQ9SFNpmvkD3Get9hs9ksmUZRN0tHHbWr8r1LpPe98TAddP wPZwzqg5bqCh3z4RvQXbgjwsgzrWZu+Y0Trr8TK3SHjXihoLAgo9xYSD5GE99Xjou+sxoS nTIteR3WXi41ANaSpYHWXUdYV7JbTZqESNxfZruVgiigC730GEogaWwtOUonBQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.96 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 7C60C25329 X-Spam-Score: -2.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: sNzkJOw7TRY5 Hi! Julien Lepiller skribis: > The attached patch reimplements the download-po target in Makefile.am. > The previous implementation was based on the implementation for the TP > and would use the API of Weblate to get files. > > However, the rate-limit is very close to the number of files we need to > download, which was a big limitation, and this target would only > download existing files, ignoring new translations. OK. > To document the new process: > > make download-po > for any new file in po/guix and po/packages, add the language in a > single line in po/guix/LINGUAS or po/packages/LINGUAS. > for any new file in po/doc, add the file name to po/doc/local.mk, in > DOC_PO_FILES or DOC_COOKBOOK_PO_FILES depending on the translation > type. Add the texi file name to doc/local.mk too, in info_TEXINFOS. Alright. This looks like a nice improvement! Some nitpicking follows, but it LGTM overall. >>>From 5c14506d6af24b5307e03604cabf8ca10af56067 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Sun, 18 Apr 2021 23:56:48 +0200 > Subject: [PATCH] Makefile: Reimplement `download-po` target. > > The weblate API rate limit is very close to the number of files we need > to download. The previous implementation did not add new translations. > > * Makefile.am (download-po): Update target. > (make-download-po, make-check-po): Remove functions. Should be: (make-download-po-rule, make-check-po-rule) > - rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ > - mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp2,} ; \ That was kinda crazy, I=E2=80=99m glad you divided the number of dollars by two. :-) > +WEBLATE_REPO=3D"https://framagit.org/tyreunom/guix-translations" Since it=E2=80=99s not shell, rather: WEBLATE_REPO =3D https://framagit.org/tyreunom/guix-translations BTW, I vaguely remember we asked for a Savannah repo but I=E2=80=99m not su= re what the outcome was; did it eventually stall for some obscure reason? > +# shallow clone the git repository behind weblate and copy files from it= if > +# they contain at least one translation, and they are well-formed (schem= e format > +# only), warn otherwise. Copied files are converted to a canonical form. Please capitalize sentences and proper names. > +download-po: > + dir=3D$$(mktemp -d); \ > + git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations"; \ > + for domain in po/doc po/guix po/packages; do \ > + for po in "$$dir/translations/$$domain"/*.po; do \ > + translated=3D$$(LANG=3Den_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | = cut -f1 -d' '); \ > + target=3D$$(basename "$$po"); \ > + target=3D"$$domain/$$target"; \ > + if msgfmt -c "$$po" && [ "$$translated" !=3D "0" ]; then \ > + msgfilter --no-wrap -i "$$po" cat > "$$target"; \ Maybe write to $$target.tmp and then do =E2=80=9Cmv $$target.tmp $$target= =E2=80=9D so it=E2=80=99s atomic and we don=E2=80=99t end up with corrupt files if =E2= =80=98msgfilter=E2=80=99 fails. I would use spaces rather than tabs to indent the =E2=80=98for=E2=80=99 loo= ps. Thanks! Ludo=E2=80=99.