mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-04 18:07:24 +01:00
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>
This commit is contained in:
parent
756e336fa0
commit
c3d48d024b
1 changed files with 11 additions and 4 deletions
|
@ -164,13 +164,20 @@ (define-command (guix-time-machine . args)
|
||||||
(define (validate-guix-channel channels)
|
(define (validate-guix-channel channels)
|
||||||
"Finds the Guix channel among CHANNELS, and validates that REF as
|
"Finds the Guix channel among CHANNELS, and validates that REF as
|
||||||
captured from the closure, a git reference specification such as a commit hash
|
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
|
or tag associated to the channel, is valid and new enough to satisfy the 'guix
|
||||||
time-machine' requirements. A `formatted-message' condition is raised
|
time-machine' requirements. If the captured REF variable is #f, the reference
|
||||||
otherwise."
|
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))
|
(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
|
(checkout commit relation (update-cached-checkout
|
||||||
(channel-url guix-channel)
|
(channel-url guix-channel)
|
||||||
#:ref (or ref '())
|
#:ref reference
|
||||||
#:starting-commit
|
#:starting-commit
|
||||||
%oldest-possible-commit)))
|
%oldest-possible-commit)))
|
||||||
(unless (memq relation '(ancestor self))
|
(unless (memq relation '(ancestor self))
|
||||||
|
|
Loading…
Reference in a new issue