mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
channels: Add 'latest-channel-instance'.
* guix/channels.scm (latest-channel-instance): New procedure. (latest-channel-instances): Use it.
This commit is contained in:
parent
c263cfdcde
commit
4ba425060a
1 changed files with 18 additions and 14 deletions
|
@ -199,6 +199,14 @@ (define (channel-instance-dependencies instance)
|
||||||
channel INSTANCE."
|
channel INSTANCE."
|
||||||
(channel-metadata-dependencies (channel-instance-metadata instance)))
|
(channel-metadata-dependencies (channel-instance-metadata instance)))
|
||||||
|
|
||||||
|
(define (latest-channel-instance store channel)
|
||||||
|
"Return the latest channel instance for CHANNEL."
|
||||||
|
(let-values (((checkout commit)
|
||||||
|
(latest-repository-commit store (channel-url channel)
|
||||||
|
#:ref (channel-reference
|
||||||
|
channel))))
|
||||||
|
(channel-instance channel commit checkout)))
|
||||||
|
|
||||||
(define* (latest-channel-instances store channels #:optional (previous-channels '()))
|
(define* (latest-channel-instances store channels #:optional (previous-channels '()))
|
||||||
"Return a list of channel instances corresponding to the latest checkouts of
|
"Return a list of channel instances corresponding to the latest checkouts of
|
||||||
CHANNELS and the channels on which they depend. PREVIOUS-CHANNELS is a list
|
CHANNELS and the channels on which they depend. PREVIOUS-CHANNELS is a list
|
||||||
|
@ -224,11 +232,7 @@ (define-values (resulting-channels instances)
|
||||||
(G_ "Updating channel '~a' from Git repository at '~a'...~%")
|
(G_ "Updating channel '~a' from Git repository at '~a'...~%")
|
||||||
(channel-name channel)
|
(channel-name channel)
|
||||||
(channel-url channel))
|
(channel-url channel))
|
||||||
(let-values (((checkout commit)
|
(let ((instance (latest-channel-instance store channel)))
|
||||||
(latest-repository-commit store (channel-url channel)
|
|
||||||
#:ref (channel-reference
|
|
||||||
channel))))
|
|
||||||
(let ((instance (channel-instance channel commit checkout)))
|
|
||||||
(let-values (((new-instances new-channels)
|
(let-values (((new-instances new-channels)
|
||||||
(latest-channel-instances
|
(latest-channel-instances
|
||||||
store
|
store
|
||||||
|
@ -237,7 +241,7 @@ (define-values (resulting-channels instances)
|
||||||
(values (append (cons channel new-channels)
|
(values (append (cons channel new-channels)
|
||||||
previous-channels)
|
previous-channels)
|
||||||
(append (cons instance new-instances)
|
(append (cons instance new-instances)
|
||||||
instances))))))))
|
instances)))))))
|
||||||
previous-channels
|
previous-channels
|
||||||
'() ;instances
|
'() ;instances
|
||||||
channels))
|
channels))
|
||||||
|
|
Loading…
Reference in a new issue