summaryrefslogtreecommitdiff
path: root/guix/grafts.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/grafts.scm')
-rw-r--r--guix/grafts.scm15
1 files changed, 13 insertions, 2 deletions
diff --git a/guix/grafts.scm b/guix/grafts.scm
index 80ae27e9b0..dda7c1d235 100644
--- a/guix/grafts.scm
+++ b/guix/grafts.scm
@@ -280,8 +280,19 @@ derivations to the corresponding set of grafts."
(let* ((new (graft-derivation/shallow store drv applicable
#:guile guile
#:system system))
- (grafts (cons (graft (origin drv) (replacement new))
- grafts)))
+
+ ;; Replace references to any of the outputs of DRV,
+ ;; even if that's more than needed. This is so that
+ ;; the result refers only to the outputs of NEW and
+ ;; not to those of DRV.
+ (grafts (append (map (lambda (output)
+ (graft
+ (origin drv)
+ (origin-output output)
+ (replacement new)
+ (replacement-output output)))
+ (derivation-output-names drv))
+ grafts)))
(return/cache cache grafts))))))))))))
(define* (graft-derivation store drv grafts