mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-15 19:35:25 -05:00
channels: Add the channel name to channel sexps.
* guix/channels.scm (channel-instance->sexp): Add 'name'. (sexp->channel): Extract the name from SEXP, using the optional argument as a fallback.
This commit is contained in:
parent
9272cc700e
commit
a47f16a874
1 changed files with 11 additions and 4 deletions
|
@ -812,6 +812,7 @@ (define (channel-instance->sexp instance)
|
||||||
(url ,(channel-url channel))
|
(url ,(channel-url channel))
|
||||||
(branch ,(channel-branch channel))
|
(branch ,(channel-branch channel))
|
||||||
(commit ,commit)
|
(commit ,commit)
|
||||||
|
(name ,(channel-name channel))
|
||||||
,@(if intro
|
,@(if intro
|
||||||
`((introduction
|
`((introduction
|
||||||
(channel-introduction
|
(channel-introduction
|
||||||
|
@ -907,16 +908,22 @@ (define* (latest-channel-derivation #:optional (channels %default-channels)
|
||||||
(channel-instances->derivation instances)))
|
(channel-instances->derivation instances)))
|
||||||
|
|
||||||
(define* (sexp->channel sexp #:optional (name 'channel))
|
(define* (sexp->channel sexp #:optional (name 'channel))
|
||||||
"Read SEXP, a provenance sexp as created by 'channel-instance->sexp',
|
"Read SEXP, a provenance sexp as created by 'channel-instance->sexp'; use
|
||||||
and return a channel called NAME. Return #f if the sexp does not have the
|
NAME as the channel name if SEXP does not specify it. Return #f if the sexp
|
||||||
expected structure."
|
does not have the expected structure."
|
||||||
(match sexp
|
(match sexp
|
||||||
(('repository ('version 0)
|
(('repository ('version 0)
|
||||||
('url url)
|
('url url)
|
||||||
('branch branch)
|
('branch branch)
|
||||||
('commit commit)
|
('commit commit)
|
||||||
rest ...)
|
rest ...)
|
||||||
(channel (name name)
|
;; Historically channel sexps did not include the channel name. It's OK
|
||||||
|
;; for channels created by 'channel-instances->manifest' because the
|
||||||
|
;; entry name is the channel name, but it was missing for entries created
|
||||||
|
;; by 'manifest-entry-with-provenance'.
|
||||||
|
(channel (name (match (assq 'name rest)
|
||||||
|
(#f name)
|
||||||
|
(('name name) name)))
|
||||||
(url url)
|
(url url)
|
||||||
(commit commit)
|
(commit commit)
|
||||||
(introduction
|
(introduction
|
||||||
|
|
Loading…
Reference in a new issue