From 07340cbebc1ef97c0196c631144775f5ce61d4f6 Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Sat, 5 Dec 2020 17:20:10 +0100 Subject: profiles: Delete duplicate manifest entries in packages->manifest. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/profiles.scm (packages->manifest): Delete duplicate entries. * tests/profiles.scm ("packages->manifest, no duplicates"): New test. Signed-off-by: Ludovic Courtès --- guix/profiles.scm | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'guix/profiles.scm') diff --git a/guix/profiles.scm b/guix/profiles.scm index 034591eb79..59a313ea08 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -399,22 +399,24 @@ denoting a specific output of a package." 'inferior-package->manifest-entry)) (manifest - (map (match-lambda - (((? package? package) output) - (package->manifest-entry package output)) - ((? package? package) - (package->manifest-entry package)) - ((thing output) - (if inferiors-loaded? - ((inferior->entry) thing output) - (throw 'wrong-type-arg 'packages->manifest - "Wrong package object: ~S" (list thing) (list thing)))) - (thing - (if inferiors-loaded? - ((inferior->entry) thing) - (throw 'wrong-type-arg 'packages->manifest - "Wrong package object: ~S" (list thing) (list thing))))) - packages))) + (delete-duplicates + (map (match-lambda + (((? package? package) output) + (package->manifest-entry package output)) + ((? package? package) + (package->manifest-entry package)) + ((thing output) + (if inferiors-loaded? + ((inferior->entry) thing output) + (throw 'wrong-type-arg 'packages->manifest + "Wrong package object: ~S" (list thing) (list thing)))) + (thing + (if inferiors-loaded? + ((inferior->entry) thing) + (throw 'wrong-type-arg 'packages->manifest + "Wrong package object: ~S" (list thing) (list thing))))) + packages) + manifest-entry=?))) (define (manifest->gexp manifest) "Return a representation of MANIFEST as a gexp." -- cgit v1.2.3