From 3d47aa81ba4c19b45ce9a9ff0ece0252777ea8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 17 Oct 2016 23:43:33 +0200 Subject: grafts: Apply the right grafts in the presence of multiple outputs. Fixes . * guix/grafts.scm (cumulative-grafts): Add grafts for all the outputs of DRV. * tests/grafts.scm ("graft-derivation, replaced derivation has multiple outputs"): New test. --- guix/grafts.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'guix/grafts.scm') 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 -- cgit v1.2.3