[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/04: upstream: Allow downgrades.
From: |
guix-commits |
Subject: |
02/04: upstream: Allow downgrades. |
Date: |
Tue, 3 Jan 2023 06:31:36 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit a330bfdf5b2f27c34b5ece82bb355553af110cfe
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Dec 27 22:53:10 2022 +0100
upstream: Allow downgrades.
Previously, 'guix refresh -u guile=3.0.0' would do nothing. With this
change, it actually downgrades 'guile'.
This is a followup to 8aeccc6240ec45f0bc7bed655e0c8149ae4253eb.
* guix/upstream.scm (package-update): Ignore 'version>?' check
when #:version is passed. Warn about downgrades.
---
guix/upstream.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/guix/upstream.scm b/guix/upstream.scm
index f3ab9ab78b..4c72388bf3 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -501,11 +501,22 @@ SOURCE, an <upstream-source>."
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)."
+values: 'always', 'never', and 'interactive' (default).
+
+When VERSION is specified, update PACKAGE to that version, even if that is a
+downgrade."
(match (package-latest-release package updaters #:version version)
((? upstream-source? source)
- (if (version>? (upstream-source-version source)
- (package-version package))
+ (if (or (version>? (upstream-source-version source)
+ (package-version package))
+ (and version
+ (begin
+ (warning (package-location package)
+ (G_ "downgrading '~a' from ~a to ~a~%")
+ (package-name package)
+ (package-version package)
+ (upstream-source-version source))
+ #t)))
(let ((method (match (package-source package)
((? origin? origin)
(origin-method origin))