profiles: Delete duplicate manifest entries in packages->manifest.
* gnu/profiles.scm (packages->manifest): Delete duplicate entries. * tests/profiles.scm ("packages->manifest, no duplicates"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
f5d952c5f5
commit
07340cbebc
@ -399,22 +399,24 @@ denoting a specific output of a package."
|
|||||||
'inferior-package->manifest-entry))
|
'inferior-package->manifest-entry))
|
||||||
|
|
||||||
(manifest
|
(manifest
|
||||||
(map (match-lambda
|
(delete-duplicates
|
||||||
(((? package? package) output)
|
(map (match-lambda
|
||||||
(package->manifest-entry package output))
|
(((? package? package) output)
|
||||||
((? package? package)
|
(package->manifest-entry package output))
|
||||||
(package->manifest-entry package))
|
((? package? package)
|
||||||
((thing output)
|
(package->manifest-entry package))
|
||||||
(if inferiors-loaded?
|
((thing output)
|
||||||
((inferior->entry) thing output)
|
(if inferiors-loaded?
|
||||||
(throw 'wrong-type-arg 'packages->manifest
|
((inferior->entry) thing output)
|
||||||
"Wrong package object: ~S" (list thing) (list thing))))
|
(throw 'wrong-type-arg 'packages->manifest
|
||||||
(thing
|
"Wrong package object: ~S" (list thing) (list thing))))
|
||||||
(if inferiors-loaded?
|
(thing
|
||||||
((inferior->entry) thing)
|
(if inferiors-loaded?
|
||||||
(throw 'wrong-type-arg 'packages->manifest
|
((inferior->entry) thing)
|
||||||
"Wrong package object: ~S" (list thing) (list thing)))))
|
(throw 'wrong-type-arg 'packages->manifest
|
||||||
packages)))
|
"Wrong package object: ~S" (list thing) (list thing)))))
|
||||||
|
packages)
|
||||||
|
manifest-entry=?)))
|
||||||
|
|
||||||
(define (manifest->gexp manifest)
|
(define (manifest->gexp manifest)
|
||||||
"Return a representation of MANIFEST as a gexp."
|
"Return a representation of MANIFEST as a gexp."
|
||||||
|
@ -384,6 +384,16 @@
|
|||||||
(manifest-entry-search-paths
|
(manifest-entry-search-paths
|
||||||
(package->manifest-entry mpl)))))
|
(package->manifest-entry mpl)))))
|
||||||
|
|
||||||
|
(test-assert "packages->manifest, no duplicates"
|
||||||
|
(let ((expected
|
||||||
|
(manifest
|
||||||
|
(list
|
||||||
|
(package->manifest-entry packages:guile-2.2))))
|
||||||
|
(manifest (packages->manifest
|
||||||
|
(list packages:guile-2.2 packages:guile-2.2))))
|
||||||
|
(every manifest-entry=? (manifest-entries expected)
|
||||||
|
(manifest-entries manifest))))
|
||||||
|
|
||||||
(test-equal "packages->manifest, propagated inputs"
|
(test-equal "packages->manifest, propagated inputs"
|
||||||
(map (match-lambda
|
(map (match-lambda
|
||||||
((label package)
|
((label package)
|
||||||
|
Loading…
Reference in New Issue
Block a user