[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/11: derivations: 'map-derivation' uses the new 'derivation' calling c
From: |
guix-commits |
Subject: |
07/11: derivations: 'map-derivation' uses the new 'derivation' calling convention. |
Date: |
Mon, 15 Jul 2019 04:18:17 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit d1458321518b07dec045deddc2e635c1a69b9e93
Author: Ludovic Courtès <address@hidden>
Date: Tue Jul 9 23:51:44 2019 +0200
derivations: 'map-derivation' uses the new 'derivation' calling convention.
* guix/derivations.scm (map-derivation)[input->output-paths]: Adjust to
deal with an argument that's either 'derivation-input?' or a string.
[rewritten-input]: Return a <derivation-input> or a string.
Pass #:inputs and #:sources to 'derivation'.
---
guix/derivations.scm | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/guix/derivations.scm b/guix/derivations.scm
index bd0af32..a184785 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -933,13 +933,10 @@ recursively."
(define input->output-paths
(match-lambda
- (((? derivation? drv))
- (list (derivation->output-path drv)))
- (((? derivation? drv) sub-drvs ...)
- (map (cut derivation->output-path drv <>)
- sub-drvs))
- ((file)
- (list file))))
+ ((? derivation-input? input)
+ (derivation-input-output-paths input))
+ ((? string? file)
+ (list file))))
(let ((mapping (fold (lambda (pair result)
(match pair
@@ -958,11 +955,11 @@ recursively."
(($ <derivation-input> drv (sub-drvs ...))
(match (vhash-assoc (derivation-file-name drv) mapping)
((_ . (? derivation? replacement))
- (cons replacement sub-drvs))
- ((_ . replacement)
- (list replacement))
+ (derivation-input replacement sub-drvs))
+ ((_ . (? string? source))
+ source)
(#f
- (cons (loop drv) sub-drvs)))))))
+ (derivation-input (loop drv) sub-drvs)))))))
(let loop ((drv drv))
(let* ((inputs (map (cut rewritten-input <> loop)
@@ -1001,7 +998,8 @@ recursively."
. ,(substitute value initial
replacements))))
(derivation-builder-environment-vars drv))
- #:inputs (append (map list sources) inputs)
+ #:inputs (filter derivation-input? inputs)
+ #:sources (append sources (filter string? inputs))
#:outputs (derivation-output-names drv)
#:hash (match (derivation-outputs drv)
((($ <derivation-output> _ algo hash))
- branch master updated (2f3c0fb -> 9af75a2), guix-commits, 2019/07/15
- 02/11: syscalls: Use 'define-as-needed' for 'AT_' constants introduced in Guile 2.2.5., guix-commits, 2019/07/15
- 01/11: compile: Report the name of the file that cannot be compiled., guix-commits, 2019/07/15
- 06/11: download: Use the new 'derivation' calling convention., guix-commits, 2019/07/15
- 03/11: derivations: 'derivation' primitive accepts <derivation> and #:sources., guix-commits, 2019/07/15
- 05/11: gnu: guile-bootstrap: Use the new 'derivation' calling convention., guix-commits, 2019/07/15
- 07/11: derivations: 'map-derivation' uses the new 'derivation' calling convention.,
guix-commits <=
- 10/11: gexp: 'lowered-gexp-guile' now returns a <derivation-input>., guix-commits, 2019/07/15
- 04/11: gexp: <lowered-gexp> separates sources from derivation inputs., guix-commits, 2019/07/15
- 09/11: derivations: Deprecate the previous calling convention., guix-commits, 2019/07/15
- 11/11: channels: Avoid use of 'derivation-input-path'., guix-commits, 2019/07/15
- 08/11: derivations: Update tests to use new calling convention., guix-commits, 2019/07/15