From unknown Tue Jun 17 20:13:37 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#53548 <53548@debbugs.gnu.org> To: bug#53548 <53548@debbugs.gnu.org> Subject: Status: [PATCH] Harden beautify-description Reply-To: bug#53548 <53548@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:13:37 +0000 retitle 53548 [PATCH] Harden beautify-description reassign 53548 guix-patches submitter 53548 Alice BRENON severity 53548 normal tag 53548 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 26 04:41:53 2022 Received: (at submit) by debbugs.gnu.org; 26 Jan 2022 09:41:53 +0000 Received: from localhost ([127.0.0.1]:50983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCeoG-0007Fj-SJ for submit@debbugs.gnu.org; Wed, 26 Jan 2022 04:41:53 -0500 Received: from lists.gnu.org ([209.51.188.17]:56686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCeoE-0007Fb-Qn for submit@debbugs.gnu.org; Wed, 26 Jan 2022 04:41:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCeoE-0005fU-Hb for guix-patches@gnu.org; Wed, 26 Jan 2022 04:41:46 -0500 Received: from lxc-smtp2.ens-lyon.fr ([140.77.167.81]:47308) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCeoC-00032D-Er for guix-patches@gnu.org; Wed, 26 Jan 2022 04:41:46 -0500 Received: from localhost (localhost [127.0.0.1]) by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTP id 9D9E1E2CDE; Wed, 26 Jan 2022 10:41:40 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr Received: from lxc-smtp2.ens-lyon.fr ([127.0.0.1]) by localhost (lxc-smtp2.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rq6n6D1-2U2q; Wed, 26 Jan 2022 10:41:40 +0100 (CET) Received: from localhost (unknown [193.52.208.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTPSA id 28FB3E2B7B; Wed, 26 Jan 2022 10:41:40 +0100 (CET) Date: Wed, 26 Jan 2022 10:41:39 +0100 From: Alice BRENON To: guix-patches@gnu.org Subject: [PATCH] Harden beautify-description Message-ID: <20220126104139.17df3cbb@ens-lyon.fr> Organization: ENS de Lyon X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/OoJ7F2jlVxLm9qnN9dThF3d" Received-SPF: pass client-ip=140.77.167.81; envelope-from=alice.brenon@ens-lyon.fr; helo=lxc-smtp2.ens-lyon.fr 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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: submit Cc: Julien Lepiller , Xinglu Chen 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.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi all, Missing metadata in packages used to break their imports, at least for opam packages, until this was fixed by Julien in 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6. When Xinglu improved the output of des [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --MP_/OoJ7F2jlVxLm9qnN9dThF3d Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, Missing metadata in packages used to break their imports, at least for opam packages, until this was fixed by Julien in 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6. When Xinglu improved the output of descriptions in 155fc235b5e1b41b4665c782365dd2bf11beae9c, it made the imports break again in the case when the `description` field is missing and Julien's fix applies, returning #f in `metadata-ref` instead of crashing. Trouble is: beautify-description expects its description argument to be a string and will crash if this assumption isn't met (when calling the `string-prefix?` predicate). This patch hopes to fix this by prepending a catch-all case in `beautify-description` to intercept all calls to it without a proper string as description. In addition, since I had to search for beautify-description in all the code base I made its import from opam.scm explicit, to carry on what I think is a good practice which I would like to see progressively enforced in guix' source code: explicit imports everywhere, to prevent accidental namespace collisions and to ease source code browsing by pointing out where everything comes from in a given source file. This patch can probably not be pushed as-is and should be improved first: - In the generated description, I think it'd be useful to point the user to the documentation page helping them to understand what is expected in a good description, so I generated a link to it on the web-hosted manual. However, this choice is arbitrary: why not an info page or the PDF ? Is there an consensus on how to refer to a page in the documentation in guix's output ? If not and we stick to the web, perhaps the `home-url` and `doc-path` variable could be declared outside of (guix import utils), perhaps turned into functions and localized to the user's preference instead of the built-in english version I used. - If all-explict use-modules policy is relevant, it should be applied to the other import modules that Xinglu edited in 155fc23. If not, then my change in guix/import/opam.scm should perhaps not be applied at all. Thanks for your feedback on this proposal ! Best regards, Alice --MP_/OoJ7F2jlVxLm9qnN9dThF3d Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-guix-import-Harden-beautify-description.patch =46rom 22f0523ef3599b45af9448bd4f31f7b8f8ce6af2 Mon Sep 17 00:00:00 2001 From: Alice BRENON Date: Wed, 26 Jan 2022 09:27:12 +0100 Subject: [PATCH] guix: import: Harden beautify-description. * guix/import/utils.scm (beautify-description): Handle non-string arguments. * guix/import/opam.scm: [use-modules] Make imports explicit for module (guix import utils). --- guix/import/opam.scm | 8 ++++++-- guix/import/utils.scm | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/guix/import/opam.scm b/guix/import/opam.scm index a6f6fe8c9f..f569c921b1 100644 --- a/guix/import/opam.scm +++ b/guix/import/opam.scm @@ -3,7 +3,7 @@ ;;; Copyright =C2=A9 2020 Martin Becze ;;; Copyright =C2=A9 2021 Xinglu Chen ;;; Copyright =C2=A9 2021 Sarah Morgensen -;;; Copyright =C2=A9 2021 Alice Brenon +;;; Copyright =C2=A9 2021, 2022 Alice Brenon ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,7 +42,11 @@ (define-module (guix import opam) #:use-module ((guix utils) #:select (cache-directory version>? call-with-temporary-output-file)) - #:use-module (guix import utils) + #:use-module ((guix import utils) #:select (beautify-description + guix-hash-url + recursive-import + spdx-string->license + url-fetch)) #:use-module ((guix licenses) #:prefix license:) #:export (opam->guix-package opam-recursive-import diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 1c3cfa3e0b..cd716e3dc7 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -10,6 +10,7 @@ ;;; Copyright =C2=A9 2021 Maxim Cournoyer ;;; Copyright =C2=A9 2021 Sarah Morgensen ;;; Copyright =C2=A9 2021 Xinglu Chen +;;; Copyright =C2=A9 2022 Alice Brenon ;;; ;;; This file is part of GNU Guix. ;;; @@ -241,6 +242,15 @@ (define* (beautify-description description #:optional = (length 80)) a proper sentence and by using two spaces between sentences, and wrap line= s at LENGTH characters." (let ((cleaned (cond + ((not (string? description)) + (let ((home-url "https://guix.gnu.org/") + (doc-path "fr/manual/devel/en/html_node/") + (page + "Synopses-and-Descriptions.html#Synopses-and-De= scriptions")) + (string-append + "Please fill in the description of your package bef= ore " + "submitting ! See " + home-url doc-path page))) ((string-prefix? "A " description) (string-append "This package provides a" (substring description 1))) --=20 2.34.0 --MP_/OoJ7F2jlVxLm9qnN9dThF3d-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 18:09:52 2022 Received: (at 53548) by debbugs.gnu.org; 31 Jan 2022 23:09:52 +0000 Received: from localhost ([127.0.0.1]:41178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEfo0-00013Y-2v for submit@debbugs.gnu.org; Mon, 31 Jan 2022 18:09:52 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:42168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEfnx-00013G-Na for 53548@debbugs.gnu.org; Mon, 31 Jan 2022 18:09:50 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B54982AD; Tue, 1 Feb 2022 00:09:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GfPsSbwhEcWQ; Tue, 1 Feb 2022 00:09:42 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9DFD61BD; Tue, 1 Feb 2022 00:09:41 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Alice BRENON Subject: Re: bug#53548: [PATCH] Harden beautify-description References: <20220126104139.17df3cbb@ens-lyon.fr> Date: Tue, 01 Feb 2022 00:09:40 +0100 In-Reply-To: <20220126104139.17df3cbb@ens-lyon.fr> (Alice BRENON's message of "Wed, 26 Jan 2022 10:41:39 +0100") Message-ID: <87ee4n8pu3.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-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: B54982AD X-Spamd-Result: default: False [0.46 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.56)[subject]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53548 Cc: 53548@debbugs.gnu.org, Xinglu Chen , Julien Lepiller 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: -0.0 (/) Hi Alice, Alice BRENON skribis: > Missing metadata in packages used to break their imports, at least for > opam packages, until this was fixed by Julien in > 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6. When Xinglu improved the > output of descriptions in 155fc235b5e1b41b4665c782365dd2bf11beae9c, it > made the imports break again in the case when the `description` field > is missing and Julien's fix applies, returning #f in `metadata-ref` > instead of crashing. Trouble is: beautify-description expects its > description argument to be a string and will crash if this assumption > isn't met (when calling the `string-prefix?` predicate). Thanks for explaining! Some comments: > From 22f0523ef3599b45af9448bd4f31f7b8f8ce6af2 Mon Sep 17 00:00:00 2001 > From: Alice BRENON > Date: Wed, 26 Jan 2022 09:27:12 +0100 > Subject: [PATCH] guix: import: Harden beautify-description. > > * guix/import/utils.scm (beautify-description): Handle non-string > arguments. > * guix/import/opam.scm: [use-modules] Make imports explicit for module > (guix import utils). [...] > #:use-module ((guix utils) #:select (cache-directory > version>? > call-with-temporary-output-file)) > - #:use-module (guix import utils) > + #:use-module ((guix import utils) #:select (beautify-description > + guix-hash-url > + recursive-import > + spdx-string->license > + url-fetch)) It can=E2=80=99t hurt. > + ((not (string? description)) > + (let ((home-url "https://guix.gnu.org/") > + (doc-path "fr/manual/devel/en/html_node/") > + (page > + "Synopses-and-Descriptions.html#Synopses-and-= Descriptions")) > + (string-append > + "Please fill in the description of your package b= efore " > + "submitting ! See " > + home-url doc-path page))) I=E2=80=99d avoid the URL and maybe make the string translatable, like so: (G_ "This package lacks a description =E2=80=A6 Run \"info '(guix) Synopses and Descriptions'\" for more information.") =E2=80=A6 where =E2=80=98G_=E2=80=99 comes from (guix i18n). WDYT? This looks like a welcome improvement to me. Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 10:37:48 2022 Received: (at 53548) by debbugs.gnu.org; 2 Feb 2022 15:37:48 +0000 Received: from localhost ([127.0.0.1]:53113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFHhS-0005mO-Pa for submit@debbugs.gnu.org; Wed, 02 Feb 2022 10:37:48 -0500 Received: from lxc-smtp2.ens-lyon.fr ([140.77.167.81]:34520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFHhO-0005mB-BD for 53548@debbugs.gnu.org; Wed, 02 Feb 2022 10:37:37 -0500 Received: from localhost (localhost [127.0.0.1]) by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTP id DFFF2E6362; Wed, 2 Feb 2022 16:37:32 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr Received: from lxc-smtp2.ens-lyon.fr ([127.0.0.1]) by localhost (lxc-smtp2.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sFANrwyW-1r2; Wed, 2 Feb 2022 16:37:32 +0100 (CET) Received: from localhost (unknown [78.194.167.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTPSA id 78711E633A; Wed, 2 Feb 2022 16:37:32 +0100 (CET) Date: Wed, 2 Feb 2022 16:37:31 +0100 From: Alice BRENON To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#53548: [PATCH] Harden beautify-description Message-ID: <20220202163731.4e3216f2@ens-lyon.fr> In-Reply-To: <87ee4n8pu3.fsf@gnu.org> References: <20220126104139.17df3cbb@ens-lyon.fr> <87ee4n8pu3.fsf@gnu.org> Organization: ENS de Lyon X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/FJyT/2uRccKhdpp_vHyMqSW" X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi ! Thank you again for the help. I think it looks really better with the translated reference to the info page. I feared the issues I raised would yield unending discussions but actually with your edit i [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53548 Cc: 53548@debbugs.gnu.org, Xinglu Chen , Julien Lepiller 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: 0.6 (/) --MP_/FJyT/2uRccKhdpp_vHyMqSW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi ! Thank you again for the help. I think it looks really better with the translated reference to the info page. I feared the issues I raised would yield unending discussions but actually with your edit it's already pretty neat while remaining very simple. That's inspiring. For the others interested in this thread, I also made the import of G_ from (guix i18n) explicit because it was being re-exported from (guix ui), and while I was at it, I made the only used import from (guix ui), that is fill-paragraph, explicit. Hope you like this second version better : ) Alice Le Tue, 01 Feb 2022 00:09:40 +0100, Ludovic Court=C3=A8s a =C3=A9crit : > Hi Alice, >=20 > Alice BRENON skribis: >=20 > > Missing metadata in packages used to break their imports, at least > > for opam packages, until this was fixed by Julien in > > 24aa7b3c21309b63cc6e8e18d6417d2cddccf6c6. When Xinglu improved the > > output of descriptions in 155fc235b5e1b41b4665c782365dd2bf11beae9c, > > it made the imports break again in the case when the `description` > > field is missing and Julien's fix applies, returning #f in > > `metadata-ref` instead of crashing. Trouble is: > > beautify-description expects its description argument to be a > > string and will crash if this assumption isn't met (when calling > > the `string-prefix?` predicate). =20 >=20 > Thanks for explaining! Some comments: >=20 > > From 22f0523ef3599b45af9448bd4f31f7b8f8ce6af2 Mon Sep 17 00:00:00 > > 2001 From: Alice BRENON > > Date: Wed, 26 Jan 2022 09:27:12 +0100 > > Subject: [PATCH] guix: import: Harden beautify-description. > > > > * guix/import/utils.scm (beautify-description): Handle non-string > > arguments. > > * guix/import/opam.scm: [use-modules] Make imports explicit for > > module (guix import utils). =20 >=20 > [...] >=20 > > #:use-module ((guix utils) #:select (cache-directory =20 > > version>? =20 > > call-with-temporary-output-file= )) > > - #:use-module (guix import utils) > > + #:use-module ((guix import utils) #:select (beautify-description > > + guix-hash-url > > + recursive-import > > + spdx-string->license > > + url-fetch)) =20 >=20 > It can=E2=80=99t hurt. >=20 > > + ((not (string? description)) > > + (let ((home-url "https://guix.gnu.org/") > > + (doc-path "fr/manual/devel/en/html_node/") > > + (page > > + > > "Synopses-and-Descriptions.html#Synopses-and-Descriptions")) > > + (string-append > > + "Please fill in the description of your > > package before " > > + "submitting ! See " > > + home-url doc-path page))) =20 >=20 > I=E2=80=99d avoid the URL and maybe make the string translatable, like so: >=20 > (G_ "This package lacks a description =E2=80=A6 > Run \"info '(guix) Synopses and Descriptions'\" for more > information.") >=20 > =E2=80=A6 where =E2=80=98G_=E2=80=99 comes from (guix i18n). >=20 > WDYT? >=20 > This looks like a welcome improvement to me. >=20 > Thanks! >=20 > Ludo=E2=80=99. --MP_/FJyT/2uRccKhdpp_vHyMqSW Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-guix-import-Harden-beautify-description.patch =46rom cfb57a40a90bfc31d1b846f3e981469285f1bd7b Mon Sep 17 00:00:00 2001 From: Alice BRENON Date: Wed, 26 Jan 2022 09:27:12 +0100 Subject: [PATCH] guix: import: Harden beautify-description. * guix/import/utils.scm (beautify-description): Handle non-string arguments. [use-modules]: Explicitly import G_ from (guix i18n) and make (guix ui) import explicit. * guix/import/opam.scm: [use-modules] Make imports explicit for module (guix import utils). --- guix/import/opam.scm | 8 ++++++-- guix/import/utils.scm | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/guix/import/opam.scm b/guix/import/opam.scm index a6f6fe8c9f..f569c921b1 100644 --- a/guix/import/opam.scm +++ b/guix/import/opam.scm @@ -3,7 +3,7 @@ ;;; Copyright =C2=A9 2020 Martin Becze ;;; Copyright =C2=A9 2021 Xinglu Chen ;;; Copyright =C2=A9 2021 Sarah Morgensen -;;; Copyright =C2=A9 2021 Alice Brenon +;;; Copyright =C2=A9 2021, 2022 Alice Brenon ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,7 +42,11 @@ (define-module (guix import opam) #:use-module ((guix utils) #:select (cache-directory version>? call-with-temporary-output-file)) - #:use-module (guix import utils) + #:use-module ((guix import utils) #:select (beautify-description + guix-hash-url + recursive-import + spdx-string->license + url-fetch)) #:use-module ((guix licenses) #:prefix license:) #:export (opam->guix-package opam-recursive-import diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 1c3cfa3e0b..934b224bec 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -10,6 +10,7 @@ ;;; Copyright =C2=A9 2021 Maxim Cournoyer ;;; Copyright =C2=A9 2021 Sarah Morgensen ;;; Copyright =C2=A9 2021 Xinglu Chen +;;; Copyright =C2=A9 2022 Alice Brenon ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,10 +38,11 @@ (define-module (guix import utils) #:use-module (guix discovery) #:use-module (guix build-system) #:use-module (guix gexp) + #:use-module ((guix i18n) #:select (G_)) #:use-module (guix store) #:use-module (guix download) #:use-module (guix sets) - #:use-module (guix ui) + #:use-module ((guix ui) #:select (fill-paragraph)) #:use-module (gnu packages) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) @@ -241,6 +243,9 @@ (define* (beautify-description description #:optional (= length 80)) a proper sentence and by using two spaces between sentences, and wrap line= s at LENGTH characters." (let ((cleaned (cond + ((not (string? description)) + (G_ "This package lacks a description. Run \"info '(gu= ix) + Synopses and Descriptions'\" for more information."= )) ((string-prefix? "A " description) (string-append "This package provides a" (substring description 1))) --=20 2.34.0 --MP_/FJyT/2uRccKhdpp_vHyMqSW-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 04:52:01 2022 Received: (at 53548-done) by debbugs.gnu.org; 8 Feb 2022 09:52:01 +0000 Received: from localhost ([127.0.0.1]:45343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHNAH-00055i-Es for submit@debbugs.gnu.org; Tue, 08 Feb 2022 04:52:01 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:35716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHNAF-00055T-Pr for 53548-done@debbugs.gnu.org; Tue, 08 Feb 2022 04:52:00 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6ECED307; Tue, 8 Feb 2022 10:51:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id weWG5KCLA6-J; Tue, 8 Feb 2022 10:51:52 +0100 (CET) Received: from ribbon (unknown [193.50.110.192]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1F6AB16C; Tue, 8 Feb 2022 10:51:52 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Alice BRENON Subject: Re: bug#53548: [PATCH] Harden beautify-description References: <20220126104139.17df3cbb@ens-lyon.fr> <87ee4n8pu3.fsf@gnu.org> <20220202163731.4e3216f2@ens-lyon.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 08 Feb 2022 10:51:51 +0100 In-Reply-To: <20220202163731.4e3216f2@ens-lyon.fr> (Alice BRENON's message of "Wed, 2 Feb 2022 16:37:31 +0100") Message-ID: <87sfstbs94.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 6ECED307 X-Spamd-Result: default: False [0.46 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; R_MIXED_CHARSET(0.56)[subject]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53548-done Cc: 53548-done@debbugs.gnu.org, Xinglu Chen , Julien Lepiller 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: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Alice BRENON skribis: > From cfb57a40a90bfc31d1b846f3e981469285f1bd7b Mon Sep 17 00:00:00 2001 > From: Alice BRENON > Date: Wed, 26 Jan 2022 09:27:12 +0100 > Subject: [PATCH] guix: import: Harden beautify-description. > > * guix/import/utils.scm (beautify-description): Handle non-string > arguments. > [use-modules]: Explicitly import G_ from (guix i18n) and make (guix ui) > import explicit. > * guix/import/opam.scm: [use-modules] Make imports explicit for module > (guix import utils). Applied. I removed extra space from the message, as shown below. Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 934b224bec..9cadbb3d5f 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -244,8 +244,8 @@ (define* (beautify-description description #:optional (length 80)) LENGTH characters." (let ((cleaned (cond ((not (string? description)) - (G_ "This package lacks a description. Run \"info '(guix) - Synopses and Descriptions'\" for more information.")) + (G_ "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information.")) ((string-prefix? "A " description) (string-append "This package provides a" (substring description 1))) --=-=-=-- From unknown Tue Jun 17 20:13:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 08 Mar 2022 12:24:10 +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