mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
profiles: Add 'concatenate-manifests'.
* guix/profiles.scm (concatenate-manifests): New procedure. * tests/profiles.scm ("concatenate-manifests"): New test.
This commit is contained in:
parent
d76df98fa5
commit
ce30a0eb7e
2 changed files with 10 additions and 0 deletions
|
@ -92,6 +92,7 @@ (define-module (guix profiles)
|
||||||
manifest-pattern-version
|
manifest-pattern-version
|
||||||
manifest-pattern-output
|
manifest-pattern-output
|
||||||
|
|
||||||
|
concatenate-manifests
|
||||||
manifest-remove
|
manifest-remove
|
||||||
manifest-add
|
manifest-add
|
||||||
manifest-lookup
|
manifest-lookup
|
||||||
|
@ -515,6 +516,10 @@ (define (read-manifest port)
|
||||||
"Return the packages listed in MANIFEST."
|
"Return the packages listed in MANIFEST."
|
||||||
(sexp->manifest (read port)))
|
(sexp->manifest (read port)))
|
||||||
|
|
||||||
|
(define (concatenate-manifests lst)
|
||||||
|
"Concatenate the manifests listed in LST and return the resulting manifest."
|
||||||
|
(manifest (append-map manifest-entries lst)))
|
||||||
|
|
||||||
(define (entry-predicate pattern)
|
(define (entry-predicate pattern)
|
||||||
"Return a procedure that returns #t when passed a manifest entry that
|
"Return a procedure that returns #t when passed a manifest entry that
|
||||||
matches NAME/OUTPUT/VERSION. OUTPUT and VERSION may be #f, in which case they
|
matches NAME/OUTPUT/VERSION. OUTPUT and VERSION may be #f, in which case they
|
||||||
|
|
|
@ -113,6 +113,11 @@ (define glibc
|
||||||
(manifest-matching-entries m (list p))
|
(manifest-matching-entries m (list p))
|
||||||
#f)))
|
#f)))
|
||||||
|
|
||||||
|
(test-equal "concatenate-manifests"
|
||||||
|
(manifest (list guile-2.0.9 glibc))
|
||||||
|
(concatenate-manifests (list (manifest (list guile-2.0.9))
|
||||||
|
(manifest (list glibc)))))
|
||||||
|
|
||||||
(test-assert "manifest-remove"
|
(test-assert "manifest-remove"
|
||||||
(let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug)))
|
(let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug)))
|
||||||
(m1 (manifest-remove m0
|
(m1 (manifest-remove m0
|
||||||
|
|
Loading…
Reference in a new issue