From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yGe2N+2IoWPl6QAAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 11:05:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EIlwN+2IoWNgrwAAauVa8A (envelope-from ) for ; Tue, 20 Dec 2022 11:05:33 +0100 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 82C34400E7 for ; Tue, 20 Dec 2022 11:05:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7Z2s-00059H-Od; Tue, 20 Dec 2022 04:36:22 -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 ) id 1p7Z2Z-0004v6-Q9 for guix-patches@gnu.org; Tue, 20 Dec 2022 04:36:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7Z2Z-00039B-H9 for guix-patches@gnu.org; Tue, 20 Dec 2022 04:36:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7Z2Z-0003UO-Cy for guix-patches@gnu.org; Tue, 20 Dec 2022 04:36:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH v3 17/18] upstream: Allow updating to a specific version. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Dec 2022 09:36:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57460 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: 57460@debbugs.gnu.org Received: via spool by 57460-submit@debbugs.gnu.org id=B57460.167152891713345 (code B ref 57460); Tue, 20 Dec 2022 09:36:03 +0000 Received: (at 57460) by debbugs.gnu.org; 20 Dec 2022 09:35:17 +0000 Received: from localhost ([127.0.0.1]:43783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Z1o-0003T6-W8 for submit@debbugs.gnu.org; Tue, 20 Dec 2022 04:35:17 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:56627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Z1l-0003Rf-5E for 57460@debbugs.gnu.org; Tue, 20 Dec 2022 04:35:13 -0500 Received: from hermia.goebel-consult.de ([87.176.134.225]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mqro7-1oTbWE24FF-00mtH5 for <57460@debbugs.gnu.org>; Tue, 20 Dec 2022 10:35:07 +0100 Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 8CBE2669AE; Tue, 20 Dec 2022 10:34:24 +0100 (CET) From: Hartmut Goebel Date: Tue, 20 Dec 2022 10:34:22 +0100 Message-Id: X-Mailer: git-send-email 2.30.6 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:LBDY/sOe6KGOH4p190O3bbMEj1hPonazQiMel/vhxCBbObHWrxb 2OmKk/CMx+CuDqxkqP+slr2LHMBS/90ESFpoAfaEpyWvcm9XTMVKqBH3W528UNvYR63gx8e gQ/Q3rCdw7mtg2uKTNupkZdQslf1jFiUXj7vvCJGU93q5y7F1wXe/M7dg+Iar//PV+OjPx8 u4IDpT6QbYRKoPlitVFZw== UI-OutboundReport: notjunk:1;M01:P0:Df6qYKK1Mgk=;6qOWoGZVWh9SzObXHPwNMImo5Lt yrNewxcUfw23w7nq9rRh8gL02OsJ9LTxgVDQDeeIuRblpoYPo91S1t81buvGion1GHqbe6Tcp Pg8XQeAd5537QRXD12DXn2TckzW+RZ9Lk+m7iJ/ytVfSKGOVM1PVamo1qPMwHhYrFPxbzL9Av KJJo2oi/SUBkpvyt228qAU+UKaIw4xb8H6loMovzCtoXa9W/M01DIRAbyKoayaQN4uxUdA7Nk /8kXSrL4Xnj7uuXd2KALyIhYQbSpgUtSVCYsCdovWqqZumjr1OxzVjQLrFebP1GOd4iJKtEPi 1K61BypbBgI72WGr4OT0CGRyJehXH3gesLItoxLhjMH3ALwJ3yyAIBPNIkU5jGWsKgc1iFKq/ nZnnT8w4h7Rbk8YJAz8lrxyaPo6ZNM8pziYGqU8usxpAXo1HaIb1BxbFrn4NwrjgSwvq1Tu8v ULwgy0QouAyxrhpGztd6gJmrRUbRiTs+YYX1t7vjvXucYk9q29O54rDvl3qUNNEBaoxMeZPsT xbfvR/5308Mycs5Jf534Dueprn1UzPj1h+vnYXdpTbTyJk7yTWxgNkAtD8rjI/MPy5Jy4j5Gs SoA2Ef3A74hkQ7d7bxOrqSNmKefqpUzD1462l5oAzo736FLwzigma8sSnYSmyffgBzy6eiMdx 3+9CyfcR2p+q/Tkf8bpiuBgxjdI1ptZpqnTKUA0JyKPiuqb86c6hywsjnFdrHc8= 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671530733; a=rsa-sha256; cv=none; b=lPRiCXWLk2tCyqTYjQTxa2rtlGBMfLk2JHft7yq/V4UMRZKOku+hdf/2/FOzoIFH2eYMUB SiJH69zb25WNtbCbMcih1XytBDdm/SiI/igv9c0q7jky6tjiePQrgUY0ijBo7gFMvBkLPi +cz/iluldCKe/YTVFb40aHzYUM0HF3AtrUB25yZlF90JDZKNdy1v08183WR5Jd3Raac9Jk OmoktjMHQaK3WlbeVJIwQyHqiBXd9lMLB1Lpf8h7Ii+ZdomC0XU8uaJvLOsK9tsMpRDWYN DNbCgL6QPPR0sRN0aZrT04HUADqLj7K6BoTMbPnWYu6t3Akj8vRB4cgfsRvscA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671530733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=IRFdXWpM87rLtgXwZZ8aEEXxlxuKHwO8YbQYUJdr2mE=; b=g/L7rBb4/uaGly3BZhMEmTSgkGPM1CB2TGYlXnXBrdrTeiomehF3Kt+ovAEUyvMHmL/Uuk WXlP2hJX1X8FFRdVYkhpe6z4CSZqd6zsOT299fxXKqh3KWYPbAQPzC7gCo4VBPdBXGUoS6 XhiKwm9jNG8b5CZSmxXpB2egqb+NCzgYZ5pTsCePEz39rYaosVxhzrFRRUZZPLIaVsoKri yxh5jAqKYaVS+SJbwgk8oPJ5QcCl7yibO2EPwdFqM+yUhLC1yeakjdXTsV1zDCzs4jSOLa wCC467wxpYKJeLfydTezSOOSINuJTI64Cn4j7twDJalnaIplQlelqTA5W1Vocg== X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Spam-Score: -2.99 X-Spam-Score: -2.99 X-Migadu-Queue-Id: 82C34400E7 X-TUID: 8jd3CRWPqlcN * guix/upstream.scm(package-latest-release): Add keyword-argument 'version' and pass it on to the updater's 'import' function. (package-update): add keyword-argument 'version' and pass it on to package-latest-release. Differentiate the error message issued when no package was found, depending on whether version was given or not. --- guix/upstream.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/guix/upstream.scm b/guix/upstream.scm index 3b576898ec..f3ab9ab78b 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2019, 2022 Ricardo Wurmus ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021, 2022 Maxime Devos +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -278,7 +279,8 @@ them matches." (define* (package-latest-release package #:optional - (updaters (force %updaters))) + (updaters (force %updaters)) + #:key (version #f)) "Return an upstream source to update PACKAGE, a object, or #f if 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 @@ -287,7 +289,7 @@ one." (any (match-lambda (($ name description pred import) (and (pred package) - (import package)))) + (import package #:version version)))) updaters)) (define* (package-latest-release* package @@ -494,13 +496,13 @@ SOURCE, an ." (define* (package-update store package #:optional (updaters (force %updaters)) - #:key (key-download 'interactive)) + #:key (key-download 'interactive) (version #f)) "Return the new version, the file name of the new version tarball, and input changes for PACKAGE; return #f (three values) when PACKAGE is up-to-date; raise an error when the updater could not determine available releases. KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'always', 'never', and 'interactive' (default)." - (match (package-latest-release package updaters) + (match (package-latest-release package updaters #:version version) ((? upstream-source? source) (if (version>? (upstream-source-version source) (package-version package)) @@ -524,8 +526,11 @@ this method: ~s") (values #f #f #f))) (#f ;; Warn rather than abort so that other updates can still take place. - (warning (G_ "updater failed to determine available releases for ~a~%") - (package-name package)) + (if version + (warning (G_ "updater failed to find release ~a@~a~%") + (package-name package) version) + (warning (G_ "updater failed to determine available releases for ~a~%") + (package-name package))) (values #f #f #f)))) (define* (update-package-source package source hash) -- 2.30.6