channels: Simplify 'channel-instances->manifest'.
* guix/channels.scm (channel-instances->manifest)[instance->entry]: Change to take two arguments instead of a tuple. Turn into a non-monadic procedure. Call it via 'map' instead of 'mapm'.
This commit is contained in:
parent
403f2189aa
commit
d9e6217f4e
|
@ -429,32 +429,27 @@ derivation."
|
||||||
(define (channel-instances->manifest instances)
|
(define (channel-instances->manifest instances)
|
||||||
"Return a profile manifest with entries for all of INSTANCES, a list of
|
"Return a profile manifest with entries for all of INSTANCES, a list of
|
||||||
channel instances."
|
channel instances."
|
||||||
(define instance->entry
|
(define (instance->entry instance drv)
|
||||||
(match-lambda
|
(let ((commit (channel-instance-commit instance))
|
||||||
((instance drv)
|
(channel (channel-instance-channel instance)))
|
||||||
(let ((commit (channel-instance-commit instance))
|
(manifest-entry
|
||||||
(channel (channel-instance-channel instance)))
|
(name (symbol->string (channel-name channel)))
|
||||||
(with-monad %store-monad
|
(version (string-take commit 7))
|
||||||
(return (manifest-entry
|
(item (if (guix-channel? channel)
|
||||||
(name (symbol->string (channel-name channel)))
|
(if (old-style-guix? drv)
|
||||||
(version (string-take commit 7))
|
(whole-package-for-legacy (string-append name "-" version)
|
||||||
(item (if (guix-channel? channel)
|
drv)
|
||||||
(if (old-style-guix? drv)
|
drv)
|
||||||
(whole-package-for-legacy
|
drv))
|
||||||
(string-append name "-" version)
|
(properties
|
||||||
drv)
|
`((source (repository
|
||||||
drv)
|
(version 0)
|
||||||
drv))
|
(url ,(channel-url channel))
|
||||||
(properties
|
(branch ,(channel-branch channel))
|
||||||
`((source (repository
|
(commit ,commit))))))))
|
||||||
(version 0)
|
|
||||||
(url ,(channel-url channel))
|
|
||||||
(branch ,(channel-branch channel))
|
|
||||||
(commit ,commit))))))))))))
|
|
||||||
|
|
||||||
(mlet* %store-monad ((derivations (channel-instance-derivations instances))
|
(mlet* %store-monad ((derivations (channel-instance-derivations instances))
|
||||||
(entries (mapm %store-monad instance->entry
|
(entries -> (map instance->entry instances derivations)))
|
||||||
(zip instances derivations))))
|
|
||||||
(return (manifest entries))))
|
(return (manifest entries))))
|
||||||
|
|
||||||
(define (package-cache-file manifest)
|
(define (package-cache-file manifest)
|
||||||
|
|
Loading…
Reference in New Issue