From patchwork Sun Oct 6 23:55:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 68658 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B2D7327BBE2; Mon, 7 Oct 2024 00:57:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9E89A27BBE9 for ; Mon, 7 Oct 2024 00:57:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxb7R-0004WJ-87; Sun, 06 Oct 2024 19:56:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxb7Q-0004Vq-1U for guix-patches@gnu.org; Sun, 06 Oct 2024 19:56:56 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxb7P-0000fj-Q6 for guix-patches@gnu.org; Sun, 06 Oct 2024 19:56:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=lqH3vuVy7R0wiVtwQCjrNEDHgtCuCM5ajc+RccoYXJc=; b=tRZK4wRBvPu+2pazXRnr2MQ5MWTPHmu6uElX8XqR9AO588jUmq+f720ZS91f5zZzQqG5waVWkQYm90diTyks/383K4gvKieeA/KTk+B6MxIOaIaUFs0pE0buaNdb1amBr/iq31f8dU2D1FEccMIqUI4h8r8zoQwCovd16J3ockZRxiD7484LgjZhyUJg9LMh4lqAmQcQvM42uOq2QyUzWyT0VDMVnOizvBwj+LrzEV2kc1NLRw/CYzQJr7wP9QPqS7LWV4moRVIjY+QiPjS5fkF+/6FDD+e4SV3ygn0I+zOhtYN/xfZsdaThxW1C/C16WVRXLxtICTbOrLfkP9yuig==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sxb7V-0001p9-UL for guix-patches@gnu.org; Sun, 06 Oct 2024 19:57:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70227] [PATCH v2 1/2] guix: import: composer: Handle parsing failures. References: <20240406020415.9360-1-ngraves@ngraves.fr> In-Reply-To: <20240406020415.9360-1-ngraves@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Oct 2024 23:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70227 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70227@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 70227-submit@debbugs.gnu.org id=B70227.17282589826943 (code B ref 70227); Sun, 06 Oct 2024 23:57:01 +0000 Received: (at 70227) by debbugs.gnu.org; 6 Oct 2024 23:56:22 +0000 Received: from localhost ([127.0.0.1]:42918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxb6r-0001nu-VH for submit@debbugs.gnu.org; Sun, 06 Oct 2024 19:56:22 -0400 Received: from 4.mo582.mail-out.ovh.net ([87.98.184.159]:33529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxb6n-0001ng-Iy for 70227@debbugs.gnu.org; Sun, 06 Oct 2024 19:56:20 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.25.169]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 4XMK1P1Jfhz1M4B for <70227@debbugs.gnu.org>; Sun, 6 Oct 2024 23:56:08 +0000 (UTC) Received: from ghost-submission-55b549bf7b-rnhqs (unknown [10.108.54.132]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 9AD191FD15; Sun, 6 Oct 2024 23:56:08 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-55b549bf7b-rnhqs with ESMTPSA id U/b8EpgjA2cLkgcAJichJw (envelope-from ); Sun, 06 Oct 2024 23:56:08 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001ee546021-ac5d-417c-af0a-775a314de644, A12302D5D8CF0E033BA678025A323BF4FAD59D46) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 86.246.19.221 Date: Mon, 7 Oct 2024 01:55:59 +0200 Message-ID: <20241006235605.24248-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Ovh-Tracer-Id: 2564799991059112674 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvkedgvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekiedrvdegiedrudelrddvvddupdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtvddvjeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=lqH3vuVy7R0wiVtwQCjrNEDHgtCuCM5ajc+RccoYXJc=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1728258969; v=1; b=bf7VSJ1UkuhSXPNF6rCjgdKSAseWfamtXzF7gd4LKWiLr9HK9WIaI5X5bwgaSosLun0WGqr4 c4Xiy1o8UGZwnWINZOFZKZ4zpjfJEEW2mgj3RTdwL003fWy1RD/LQMhOatVXF/K/539eB5V/VpI aFJM5PfhpS4//7f4KWpK7059djSB6GeI6x+fEByMjnQbxD7QORtQ3aJpWaxRNi+a7stJ3JUyQ4J 3eGUAkwPlsHLafv4NNRxH0LnkuQPKTOKj3Hvjsjlpo+QwgXlsa3F1tKmW3e4bYEN3VWNbq82EHJ yQDWkI2s5lh02VOQfcrCr0tVsmyCaYNDFEf8HKaEwrG+Q== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/composer (latest-release): Handle parsing failures. Rename package to composer-package for clarity. Change-Id: I57f6fba7b05122b031177681e76cf0b5c9547736 --- guix/import/composer.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 1ad608964b..75419ca63e 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -243,16 +243,19 @@ (define (php-package? package) (eq? (package-build-system package) composer-build-system) (string-prefix? "php-" (package-name package)))) -(define (latest-release package) +(define* (latest-release package #:key (version #f)) "Return an for the latest release of PACKAGE." (let* ((php-name (guix-package->composer-name package)) - (package (composer-fetch php-name)) - (version (composer-package-version package)) - (url (composer-source-url (composer-package-source package)))) - (upstream-source - (package (package-name package)) - (version version) - (urls (list url))))) + (composer-package (composer-fetch php-name #:version version))) + (if composer-package + (upstream-source + (package (composer-package-name composer-package)) + (version (composer-package-version composer-package)) + (urls (list (composer-source-url + (composer-package-source composer-package))))) + (begin + (warning (G_ "failed to parse ~a~%") php-name) + #f)))) (define %composer-updater (upstream-updater