[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#57460] [PATCH v3 17/18] upstream: Allow updating to a specific vers
From: |
Hartmut Goebel |
Subject: |
[bug#57460] [PATCH v3 17/18] upstream: Allow updating to a specific version. |
Date: |
Tue, 20 Dec 2022 10:34:22 +0100 |
* 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 <rekado@elephly.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; 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 <package> 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
(($ <upstream-updater> 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 <upstream-source>."
(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
- [bug#57460] [PATCH v3 00/18] Refresh to specific version, Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 01/18] upstream-updater: Rename record field., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 07/18] import: egg: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 06/18] import: crate: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 02/18] import: cpan: Remove unused exports., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 11/18] import: gnome: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 08/18] import: gem: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 05/18] gnu-maintenance: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 13/18] import: kde: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 17/18] upstream: Allow updating to a specific version.,
Hartmut Goebel <=
- [bug#57460] [PATCH v3 18/18] doc: Describe how to update to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 03/18] import: Issue error-message if version is given., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 10/18] import: github: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 12/18] import: hexpm: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 09/18] import: git: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 14/18] import: launchpad: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 16/18] refresh: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 15/18] import: pypi: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 04/18] import: sourceforge: Issue error-message if version is given., Hartmut Goebel, 2022/12/20