aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-19 21:49:22 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-19 22:56:27 +0200
commit2ef22a9f371276be0b1474c512f125d1f0d0c064 (patch)
tree2e28fb3f092f0cb3648bcc01c6d2f427c28cae98
parent74247b80e5f8e1b385dbcc82df4851c2ee5792f3 (diff)
downloadguix-2ef22a9f371276be0b1474c512f125d1f0d0c064.tar
guix-2ef22a9f371276be0b1474c512f125d1f0d0c064.tar.gz
derivations: Add 'derivation-input-derivation'.
* guix/derivations.scm (derivation-input-derivation): New procedure. (derivation-prerequisites): Use it.
-rw-r--r--guix/derivations.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index cad77bdb06..8145d51143 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."