derivations: 'map-derivation' no longer calls 'read-derivation-from-file'.

This is a followup to 5cf4b26d52.

* guix/derivations.scm (map-derivation)[rewritten-input]: Avoid call to
'read-derivation-from-file'.
master
Ludovic Courtès 2019-07-03 22:27:17 +02:00
parent e6a57949f6
commit 1653b23564
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 3 additions and 5 deletions

View File

@ -948,16 +948,14 @@ recursively."
;; in the format used in 'derivation' calls. ;; in the format used in 'derivation' calls.
(mlambda (input loop) (mlambda (input loop)
(match input (match input
(($ <derivation-input> (= derivation-file-name path) (($ <derivation-input> drv (sub-drvs ...))
(sub-drvs ...)) (match (vhash-assoc (derivation-file-name drv) mapping)
(match (vhash-assoc path mapping)
((_ . (? derivation? replacement)) ((_ . (? derivation? replacement))
(cons replacement sub-drvs)) (cons replacement sub-drvs))
((_ . replacement) ((_ . replacement)
(list replacement)) (list replacement))
(#f (#f
(let* ((drv (loop (read-derivation-from-file path)))) (cons (loop drv) sub-drvs)))))))
(cons drv sub-drvs))))))))
(let loop ((drv drv)) (let loop ((drv drv))
(let* ((inputs (map (cut rewritten-input <> loop) (let* ((inputs (map (cut rewritten-input <> loop)