[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gexp: Make sure 'gexp-outputs' removes duplicate outputs.
From: |
Ludovic Courtès |
Subject: |
01/01: gexp: Make sure 'gexp-outputs' removes duplicate outputs. |
Date: |
Mon, 02 Mar 2015 15:28:16 +0000 |
civodul pushed a commit to branch core-updates
in repository guix.
commit 7e75a6739bf02c39baf8340e31e590c2c7c5fd16
Author: Ludovic Courtès <address@hidden>
Date: Mon Mar 2 16:26:13 2015 +0100
gexp: Make sure 'gexp-outputs' removes duplicate outputs.
Fixes a regression introduced in f9efe56.
* guix/gexp.scm (gexp-outputs): Add call to 'delete-duplicates'.
* tests/gexp.scm ("output list, combined gexps, duplicate output"): New
test.
---
guix/gexp.scm | 3 ++-
tests/gexp.scm | 7 +++++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 1f64cf7..1e26342 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -319,7 +319,8 @@ references."
(_
result)))
- (add-reference-output (gexp-references exp) '()))
+ (delete-duplicates
+ (add-reference-output (gexp-references exp) '())))
(define* (gexp->sexp exp #:key
(system (%current-system))
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 2ec6c8e..783ca2c 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -230,6 +230,13 @@
(gexp-outputs exp2))
(= 2 (length (gexp-outputs exp2))))))
+(test-equal "output list, combined gexps, duplicate output"
+ 1
+ (let* ((exp0 (gexp (mkdir (ungexp output))))
+ (exp1 (gexp (begin (mkdir (ungexp output)) (ungexp exp0))))
+ (exp2 (gexp (begin (mkdir (ungexp output)) (ungexp exp1)))))
+ (length (gexp-outputs exp2))))
+
(test-assert "output list + ungexp-splicing list, combined gexps"
(let* ((exp0 (gexp (mkdir (ungexp output))))
(exp1 (gexp (mkdir (ungexp output "foo"))))