[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
40/40: time-machine: Also validate the reference from a channels file.
From: |
guix-commits |
Subject: |
40/40: time-machine: Also validate the reference from a channels file. |
Date: |
Tue, 5 Sep 2023 20:02:25 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit c3d48d024b95f57850ec429d7f326d817dda5090
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Sep 5 17:04:12 2023 -0400
time-machine: Also validate the reference from a channels file.
* guix/scripts/time-machine.scm (guix-time-machine)
<validate-guix-channel>: Update doc. Fall-back to use the Guix channel
reference when REF is #f.
Reported-by: Simon Tournier <zimon.toutoune@gmail.com>
Co-authored-by: Simon Tournier <zimon.toutoune@gmail.com>
---
guix/scripts/time-machine.scm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index 87000d82ec..3ecf735acb 100644
--- a/guix/scripts/time-machine.scm
+++ b/guix/scripts/time-machine.scm
@@ -164,13 +164,20 @@ Execute COMMAND ARGS... in an older version of Guix.\n"))
(define (validate-guix-channel channels)
"Finds the Guix channel among CHANNELS, and validates that REF as
captured from the closure, a git reference specification such as a commit hash
-or tag associated to CHANNEL, is valid and new enough to satisfy the 'guix
-time-machine' requirements. A `formatted-message' condition is raised
-otherwise."
+or tag associated to the channel, is valid and new enough to satisfy the 'guix
+time-machine' requirements. If the captured REF variable is #f, the reference
+validate is the one of the Guix channel found in CHANNELS. A
+`formatted-message' condition is raised otherwise."
(let* ((guix-channel (find guix-channel? channels))
+ (guix-channel-commit (channel-commit guix-channel))
+ (guix-channel-branch (channel-branch guix-channel))
+ (guix-channel-ref (if guix-channel-commit
+ `(tag-or-commit . ,guix-channel-commit)
+ `(branch . ,guix-channel-branch)))
+ (reference (or ref guix-channel-ref))
(checkout commit relation (update-cached-checkout
(channel-url guix-channel)
- #:ref (or ref '())
+ #:ref reference
#:starting-commit
%oldest-possible-commit)))
(unless (memq relation '(ancestor self))
- 35/40: gnu-maintenance: Do not crash on refresh when origin URI is a list., (continued)
- 35/40: gnu-maintenance: Do not crash on refresh when origin URI is a list., guix-commits, 2023/09/05
- 28/40: gnu: arcan: Update to 0.6.2.1., guix-commits, 2023/09/05
- 04/40: gnu: dosbox-staging: Update to 0.80.1., guix-commits, 2023/09/05
- 02/40: gnu: mpd: Remove unused imports., guix-commits, 2023/09/05
- 13/40: gnu: pantheon-calculator: Update to 2.0.2., guix-commits, 2023/09/05
- 11/40: gnu: ibus: Add search-path for 'GUIX_GTK3_IM_MODULE_FILE'., guix-commits, 2023/09/05
- 16/40: gnu: kaidan: Update to 0.9.0., guix-commits, 2023/09/05
- 30/40: gnu: arcan: Fix paths handling., guix-commits, 2023/09/05
- 21/40: gnu: lcrq: Update to 0.1.2., guix-commits, 2023/09/05
- 25/40: gnu: efivar: Fix cross-compilation., guix-commits, 2023/09/05
- 40/40: time-machine: Also validate the reference from a channels file.,
guix-commits <=