guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: derivations: Add 'derivation-input-derivation'.


From: guix-commits
Subject: 01/05: derivations: Add 'derivation-input-derivation'.
Date: Wed, 19 Jun 2019 16:56:57 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 2ef22a9f371276be0b1474c512f125d1f0d0c064
Author: Ludovic Court├Ęs <address@hidden>
Date:   Wed Jun 19 21:49:22 2019 +0200

    derivations: Add 'derivation-input-derivation'.
    
    * guix/derivations.scm (derivation-input-derivation): New procedure.
    (derivation-prerequisites): Use it.
---
 guix/derivations.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index cad77bd..8145d51 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -62,6 +62,7 @@
             <derivation-input>
             derivation-input?
             derivation-input-path
+            derivation-input-derivation
             derivation-input-sub-derivations
             derivation-input-output-paths
             valid-derivation-input?
@@ -152,6 +153,10 @@
   (path            derivation-input-path)             ; store path
   (sub-derivations derivation-input-sub-derivations)) ; list of strings
 
+(define (derivation-input-derivation input)
+  "Return the <derivation> object INPUT refers to."
+  (read-derivation-from-file (derivation-input-path input)))
+
 (set-record-type-printer! <derivation>
                           (lambda (drv port)
                             (format port "#<derivation ~a => ~a ~a>"
@@ -243,9 +248,7 @@ result is the set of prerequisites of DRV not already in 
valid."
       (fold2 loop
              (append inputs result)
              (fold set-insert input-set inputs)
-             (map (lambda (i)
-                    (read-derivation-from-file (derivation-input-path i)))
-                  inputs)))))
+             (map derivation-input-derivation inputs)))))
 
 (define (offloadable-derivation? drv)
   "Return true if DRV can be offloaded, false otherwise."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]