summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-07-17 23:21:55 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-17 23:41:36 +0200
commit578dfbe07bcd1bdef9129c6ce8529332a0abcba6 (patch)
tree668703deb222e43c80fb85590097b6ad80591c25 /guix/gexp.scm
parent1cbcbc8600789a29c98788bab4633d00ec376554 (diff)
downloadgnu-guix-578dfbe07bcd1bdef9129c6ce8529332a0abcba6.tar
gnu-guix-578dfbe07bcd1bdef9129c6ce8529332a0abcba6.tar.gz
gexp: 'ungexp-splicing' properly accounts for nested native inputs.
Previously, (gexp-native-inputs #~#$@(list #~#+foo)) would return '(). This is a followup to 5b14a7902c58d9fb7923f9e16871f549fbe59b6e. * guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the list case, remove 'if' around 'fold-right'. In 'map' lambda, always inherit N?. * tests/gexp.scm ("gexp list splicing + ungexp-splicing"): New test.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm20
1 files changed, 11 insertions, 9 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index d9c4cb461e..2094c495d6 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -706,15 +706,17 @@ references; otherwise, return only non-native references."
(cons `(,thing ,output) result)
result))
(($ <gexp-input> (lst ...) output n?)
- (if (eqv? native? n?)
- (fold-right add-reference-inputs result
- ;; XXX: For now, automatically convert LST to a list of
- ;; gexp-inputs.
- (map (match-lambda
- ((? gexp-input? x) x)
- (x (%gexp-input x "out" (or n? native?))))
- lst))
- result))
+ (fold-right add-reference-inputs result
+ ;; XXX: For now, automatically convert LST to a list of
+ ;; gexp-inputs. Inherit N?.
+ (map (match-lambda
+ ((? gexp-input? x)
+ (%gexp-input (gexp-input-thing x)
+ (gexp-input-output x)
+ n?))
+ (x
+ (%gexp-input x "out" n?)))
+ lst)))
(_
;; Ignore references to other kinds of objects.
result)))