GNU bug report logs - #67898
[PATCH] guix: import: composer: Handle parsing failures.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Nicolas Graves <ngraves@HIDDEN>; Keywords: patch; dated Tue, 19 Dec 2023 11:21:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 67898 <at> debbugs.gnu.org:


Received: (at 67898) by debbugs.gnu.org; 19 Dec 2023 11:39:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 19 06:39:30 2023
Received: from localhost ([127.0.0.1]:34515 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFYRe-0005lw-0T
	for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 06:39:30 -0500
Received: from 4.mo561.mail-out.ovh.net ([178.33.46.10]:36001)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ngraves@HIDDEN>) id 1rFYRa-0005ld-Oe
 for 67898 <at> debbugs.gnu.org; Tue, 19 Dec 2023 06:39:28 -0500
Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.176.202])
 by mo561.mail-out.ovh.net (Postfix) with ESMTP id 641DD2C2C5
 for <67898 <at> debbugs.gnu.org>; Tue, 19 Dec 2023 11:39:22 +0000 (UTC)
Received: from ghost-submission-6684bf9d7b-2cqcn (unknown [10.110.178.151])
 by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id EFCA71FDEB;
 Tue, 19 Dec 2023 11:39:21 +0000 (UTC)
Received: from ngraves.fr ([37.59.142.102])
 by ghost-submission-6684bf9d7b-2cqcn with ESMTPSA
 id 48VcN+mAgWUd7wkAR6sYHw
 (envelope-from <ngraves@HIDDEN>); Tue, 19 Dec 2023 11:39:21 +0000
Authentication-Results: garm.ovh; auth=pass
 (GARM-102R004a9f79bf9-55cd-43df-bef2-4a603dc651ad,
 0A183DEDD9F7D7733B4F13041BD52F66DC821FED) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 81.67.140.142
From: Nicolas Graves <ngraves@HIDDEN>
To: 67898 <at> debbugs.gnu.org
Subject: [PATCH v2] guix: import: composer: Handle parsing failures.
Date: Tue, 19 Dec 2023 12:38:56 +0100
Message-ID: <20231219113857.21287-1-ngraves@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 9289237182686290653
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvddutddgfedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrddutddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeijeekleekseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67898
Cc: ludo@HIDDEN, ngraves@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/import/composer (latest-release): Handle parsing
failures. Rename package to composer-package for clarity.

Change-Id: I14936c2c6e6a850a32fe56891766ae92b693a295
---
 guix/import/composer.scm | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 069a950f90..b23af1b91f 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -246,13 +246,19 @@ (define (php-package? package)
 (define* (latest-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((php-name (guix-package->composer-name package))
-         (package (composer-fetch php-name #:version version))
-         (version (composer-package-version package))
-         (url (composer-source-url (composer-package-source package))))
-    (upstream-source
-     (package (composer-package-name package))
-     (version version)
-     (urls (list url)))))
+         (composer-package (composer-fetch php-name #:version version)))
+    (match composer-package
+      (#f
+       (format (current-error-port)
+               "warning: failed to parse ~a~%"
+               php-name)
+       #f)
+      (_
+       (upstream-source
+        (package (composer-package-name composer-package))
+        (version (composer-package-version composer-package))
+        (urls (list (composer-source-url
+                     (composer-package-source composer-package)))))))))
 
 (define %composer-updater
   (upstream-updater
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#67898; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Dec 2023 11:20:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 19 06:20:18 2023
Received: from localhost ([127.0.0.1]:34506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFY93-0001v7-Ny
	for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 06:20:18 -0500
Received: from lists.gnu.org ([2001:470:142::17]:44434)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ngraves@HIDDEN>) id 1rFY92-0001uZ-GQ
 for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 06:20:17 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>)
 id 1rFY8t-000848-3C
 for guix-patches@HIDDEN; Tue, 19 Dec 2023 06:20:08 -0500
Received: from 5.mo584.mail-out.ovh.net ([188.165.44.50])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>)
 id 1rFY8V-00046s-BO
 for guix-patches@HIDDEN; Tue, 19 Dec 2023 06:20:05 -0500
Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.139.129])
 by mo584.mail-out.ovh.net (Postfix) with ESMTP id 66B68202C6
 for <guix-patches@HIDDEN>; Tue, 19 Dec 2023 11:19:38 +0000 (UTC)
Received: from ghost-submission-6684bf9d7b-64495 (unknown [10.110.178.109])
 by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 230661FD5F;
 Tue, 19 Dec 2023 11:19:38 +0000 (UTC)
Received: from ngraves.fr ([37.59.142.101])
 by ghost-submission-6684bf9d7b-64495 with ESMTPSA
 id Md+8BEp8gWVWpAEA4uFpDA
 (envelope-from <ngraves@HIDDEN>); Tue, 19 Dec 2023 11:19:38 +0000
Authentication-Results: garm.ovh; auth=pass
 (GARM-101G0041189e5a2-81f6-4b19-a600-925af4365f50,
 0A183DEDD9F7D7733B4F13041BD52F66DC821FED) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 81.67.140.142
From: Nicolas Graves <ngraves@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] guix: import: composer: Handle parsing failures.
Date: Tue, 19 Dec 2023 12:19:31 +0100
Message-ID: <20231219111932.8729-1-ngraves@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 8955970811413717725
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvddutddgvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehguhhigidqphgrthgthhgvshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht
Received-SPF: pass client-ip=188.165.44.50; envelope-from=ngraves@HIDDEN;
 helo=5.mo584.mail-out.ovh.net
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_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: ludo@HIDDEN, ngraves@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* guix/import/composer (latest-release): Handle parsing failures.

Change-Id: I14936c2c6e6a850a32fe56891766ae92b693a295
---
 guix/import/composer.scm | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 069a950f90..b40285620d 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -246,13 +246,18 @@ (define (php-package? package)
 (define* (latest-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((php-name (guix-package->composer-name package))
-         (package (composer-fetch php-name #:version version))
-         (version (composer-package-version package))
-         (url (composer-source-url (composer-package-source package))))
-    (upstream-source
-     (package (composer-package-name package))
-     (version version)
-     (urls (list url)))))
+         (package (composer-fetch php-name #:version version)))
+    (match package
+      (#f
+       (format (current-error-port)
+               "warning: failed to parse ~a~%"
+               php-name)
+       #f)
+      (_
+       (upstream-source
+        (package (composer-package-name package))
+        (version (composer-package-version package))
+        (urls (composer-source-url (composer-package-source package))))))))
 
 (define %composer-updater
   (upstream-updater
-- 
2.41.0





Acknowledgement sent to Nicolas Graves <ngraves@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#67898; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.