From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id jGtTOdtrC2PoawEAbAwnHQ (envelope-from ) for ; Sun, 28 Aug 2022 15:21:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SH0lONtrC2N4BwEAauVa8A (envelope-from ) for ; Sun, 28 Aug 2022 15:21:31 +0200 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 918802AB2B for ; Sun, 28 Aug 2022 15:21:31 +0200 (CEST) Received: from localhost ([::1]:34688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIEE-000669-Pt for larch@yhetil.org; Sun, 28 Aug 2022 09:21:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSICw-0002zU-CY for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:11 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSICw-0002gF-0H for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSICv-0006zK-Se for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH 16/20] refresh: Allow updating to a specific version (upstream) Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Aug 2022 13:20:09 +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 To: 57460@debbugs.gnu.org Received: via spool by 57460-submit@debbugs.gnu.org id=B57460.166169278226699 (code B ref 57460); Sun, 28 Aug 2022 13:20:09 +0000 Received: (at 57460) by debbugs.gnu.org; 28 Aug 2022 13:19:42 +0000 Received: from localhost ([127.0.0.1]:57806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSICT-0006wP-C1 for submit@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:41 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:44637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSICK-0006uv-1e for 57460@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:32 -0400 Received: from hermia.goebel-consult.de ([46.87.137.46]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mzz6s-1pO7wG1tjS-00x6Yq for <57460@debbugs.gnu.org>; Sun, 28 Aug 2022 15:19:26 +0200 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 59DDA65A4C; Sun, 28 Aug 2022 15:18:56 +0200 (CEST) From: Hartmut Goebel Date: Sun, 28 Aug 2022 15:18:42 +0200 Message-Id: <02bbc32e2c9955e4bcbe535c38cafba4bc6034bc.1661691694.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:M2LKrxbOYco6sPdloA2CMg1+DDM3iE5CZ8EJ5f5Rc4z9GFrEuFE uMELBjLOKC82Vuj0GbxmbZvsnAhxN+Bq3SreVWKYxdO+2XGt6894NwfNunRo0V9jiAuLyJV WLiHD3LxtXaxKgGnl+CtiIv2y3Lz2+axaBPU0WsRHGjdZRziKy/AMlwRZWEzySeXdN+hwwd vTfaKgYwHehCk9WQFz14g== X-UI-Out-Filterresults: notjunk:1;V03:K0:PHLuffk9/RM=:cU+Rw+m+cmUpA8w2AJGaFb vF4sWN6z9k2AOnTGRAhIhFD+wjLxi8HfNAOERngZDQGtU5rCidgewa3TpiouUZ3KYef52ux73 aNySaluj2ezedErbR0XqkZ8nl46gTkuidxIcLp1wW/kf9DgWNtwH3U1AnGPgxVjFTRNE/ITXA zWnsown6M9kY3e2PN4nw6n3W7Do+4o3QhgW3Zllz7J4d44BetOXtePj2SH5aEdkK5a7t7mEXg 7NbPdKJu8h7NB6RFJ/ubjaoSBuZs1r7AaIyILc0XIB9olPfwG52cYhvv1iA6CCMDET2tEbkoK ezZL075zdkX1gccp2K3nXz+6C2KCMk0NqXe11z3qgcdyBykqyU1eAe+hjjj/d+BkBwzNTGIAV qkj3EDQPBAnEw/zmVlBwWI3O437EdEgmYUo2Z7mDt4G4JFZxqGNmS3N8GmGsHrbFveFty2YUx g7MT6LwUTT4e1+JdiEnRYSaouXCemKFtUjIXpr9nj0j6ao7HwaJcyRgGOT/lK5s55x37g2PGg sGqAPaq+98GrNbjCiOulGaBS1/S6N1WyY+Umy3IoKwnRrp2JDRkZ/JtrXwXuByiANtjfxt78R mX7KwdhehfImvEdokcaDROPN70VSWuvciZt6X2aepxruvtWA1Y0tgFL9rTOpWIsB2BnYQe6Qc KwNyVS2qK1/fAZRd83sRENsgihhwV/sihmV9uuA108vVs/qnVg8scpKPKV6dezJj9UXZNUON6 D18i79toPKcYV9HkZ5/gomLAToVLc7BJ7ZQ2yotkKdaLByhSjtpUFm5g8sU= 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661692891; 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=4Xl9WmQnLyMGJ1UJrgq2Kww0xTUKUAs24aIz38DYRnY=; b=fc+9LghEgl9StHrEsoFEu/LDbccHI+6rGK2eyZbgtHnV8PdeM9sRQsoprDwwQnDWy806qT Lr0ETpgNqtcJflrZpsqLL5VC/JxzrzFiKUYFqIgv/sJLMV5z4jFhiP9ogoltXu3yoDT/s5 rB/yi8Cl1bpxVVX7ClJmqObfxaEu1Ri6/P0gg7j8va2gZf+7qICr9AwCNTRbg/7umCIHyc vJ7wI7oOyk4WQAfow8rq42PuOt28h8IK3BgNJiE4wf2YteWOSiFupjywW+Y5isoNTHvBDU 4jYkn6PwVl7dsUilSDvj9UzxBF1UYFfxEMuqYohe/mrQQhyz/LjvOBdozvuZhg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661692891; a=rsa-sha256; cv=none; b=X5XxhVWdPeUev9pjPh0r+QkwBQdYdHEyw8GNR4xUsWKNcssGxUv+6Ay51GWXsJyZSaojBE QQ62NuXafbCZnbrH/L/vcVfEgNBEIxUvryUEz79dCfsZAM/1nWX6cPkcz5FOUD6KgkNNCm QDyToZqyU1pom5vs3uuhXOA6v4wE8ssIzK36pgyAtxAxI72yngGDZUS+2H7AhK5JLJpWXv 6YL0fAlvYkh7gDlOZuguTjRsg3jVbCWgf/IM5o2c343WBzLZ7AG71kpH75q7lZp/P9PhXy klRoeiWdcgxF71F59njTe5yEF8N+4VcDfNwMDJb44isLdG3ANJnCQzYffrIg9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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" X-Migadu-Spam-Score: -0.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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" X-Migadu-Queue-Id: 918802AB2B X-Spam-Score: -0.80 X-Migadu-Scanner: scn0.migadu.com X-TUID: Bc668/um4ONz * 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 6cee6440c3..faffb3347a 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. ;;; @@ -277,7 +278,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 @@ -286,7 +288,7 @@ one." (any (match-lambda (($ name description pred import) (and (pred package) - (import package)))) + (import package #:version version)))) updaters)) (define* (package-latest-release* package @@ -490,13 +492,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)) @@ -520,8 +522,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.4