diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-10-17 23:43:33 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-10-17 23:59:03 +0200 |
commit | 3d47aa81ba4c19b45ce9a9ff0ece0252777ea8ed (patch) | |
tree | f12190e8ba332d08806100441dfdfec8acd80586 /guix | |
parent | 645b9df858683dc05ffa04c9eb2fdc45ccef4a65 (diff) |
grafts: Apply the right grafts in the presence of multiple outputs.
Fixes <http://bugs.gnu.org/24712>.
* 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.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/grafts.scm | 15 |
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 |