From patchwork Sun Apr 4 21:03:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 28325 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 3F37B27BC6A; Sun, 4 Apr 2021 22:04:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D2C5927BC68 for ; Sun, 4 Apr 2021 22:04:24 +0100 (BST) Received: from localhost ([::1]:34754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lT9uy-0002o1-3E for patchwork@mira.cbaines.net; Sun, 04 Apr 2021 17:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lT9ud-0002n4-5h for guix-patches@gnu.org; Sun, 04 Apr 2021 17:04:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lT9uc-0000l6-Tj for guix-patches@gnu.org; Sun, 04 Apr 2021 17:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lT9uc-0000hg-Qb for guix-patches@gnu.org; Sun, 04 Apr 2021 17:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47597] [PATCH 2/3] upstream: 'package-latest-release' tries all the matching updaters. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Apr 2021 21:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47597 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47597@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 47597-submit@debbugs.gnu.org id=B47597.16175702202661 (code B ref 47597); Sun, 04 Apr 2021 21:04:02 +0000 Received: (at 47597) by debbugs.gnu.org; 4 Apr 2021 21:03:40 +0000 Received: from localhost ([127.0.0.1]:36571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lT9uF-0000gq-P7 for submit@debbugs.gnu.org; Sun, 04 Apr 2021 17:03:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lT9uB-0000gF-VQ for 47597@debbugs.gnu.org; Sun, 04 Apr 2021 17:03:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45766) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lT9u6-0000VF-Pq; Sun, 04 Apr 2021 17:03:30 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45190 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lT9u6-00049w-6V; Sun, 04 Apr 2021 17:03:30 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sun, 4 Apr 2021 23:03:15 +0200 Message-Id: <20210404210316.31198-2-ludo@gnu.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210404210316.31198-1-ludo@gnu.org> References: <20210404210316.31198-1-ludo@gnu.org> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/upstream.scm (package-latest-release): Try UPDATERS until one of them returns an upstream source. This is useful for packages with several matching updaters, such a zlib ('sourceforge' and 'generic-html'). --- guix/upstream.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/guix/upstream.scm b/guix/upstream.scm index accd8967d8..632e9ebc4f 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -264,12 +264,15 @@ them matches." #:optional (updaters (force %updaters))) "Return an upstream source to update PACKAGE, a object, or #f if -none of UPDATERS matches PACKAGE. It is the caller's responsibility to ensure -that the returned source is newer than the current one." - (match (lookup-updater package updaters) - ((? upstream-updater? updater) - ((upstream-updater-latest updater) package)) - (_ #f))) +none of UPDATERS matches PACKAGE. When several updaters match PACKAGE, try +them until one of them returns an upstream source. It is the caller's +responsibility to ensure that the returned source is newer than the current +one." + (any (match-lambda + (($ name description pred latest) + (and (pred package) + (latest package)))) + updaters)) (define* (package-latest-release* package #:optional