mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
pull: Preserve channel ordering when using '--commit', '--url', etc.
Previously using '--url', '--commit', or '--branch' would move the 'guix' channel to the front. This is okay in itself but it gratuitously leads to a different cache key in 'cached-channel-instance'--IOW, 'guix time-machine --commit=X' where X is already in cache would gratuitously recompute the channel derivations. * guix/scripts/pull.scm (channel-list): Use 'map' instead of 'find' + 'remove' + 'cons'.
This commit is contained in:
parent
6e1215fb9c
commit
a3beb8d741
1 changed files with 15 additions and 16 deletions
|
@ -769,22 +769,21 @@ (define (environment-variable)
|
|||
(url (or (assoc-ref opts 'repository-url)
|
||||
(environment-variable))))
|
||||
(if (or ref url)
|
||||
(match (find guix-channel? channels)
|
||||
((? channel? guix)
|
||||
;; Apply '--url', '--commit', and '--branch' to the 'guix' channel.
|
||||
(let ((url (or url (channel-url guix))))
|
||||
(cons (match ref
|
||||
(('commit . commit)
|
||||
(channel (inherit guix)
|
||||
(url url) (commit commit) (branch #f)))
|
||||
(('branch . branch)
|
||||
(channel (inherit guix)
|
||||
(url url) (commit #f) (branch branch)))
|
||||
(#f
|
||||
(channel (inherit guix) (url url))))
|
||||
(remove guix-channel? channels))))
|
||||
(#f ;no 'guix' channel, failure will ensue
|
||||
channels))
|
||||
;; Apply '--url', '--commit', and '--branch' to the 'guix' channel.
|
||||
(map (lambda (c)
|
||||
(if (guix-channel? c)
|
||||
(let ((url (or url (channel-url c))))
|
||||
(match ref
|
||||
(('commit . commit)
|
||||
(channel (inherit c)
|
||||
(url url) (commit commit) (branch #f)))
|
||||
(('branch . branch)
|
||||
(channel (inherit c)
|
||||
(url url) (commit #f) (branch branch)))
|
||||
(#f
|
||||
(channel (inherit c) (url url)))))
|
||||
c))
|
||||
channels)
|
||||
channels)))
|
||||
|
||||
(define (validate-cache-directory-ownership)
|
||||
|
|
Loading…
Reference in a new issue