mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-28 07:12:30 -05:00
derivations: Add 'derivation-input-derivation'.
* guix/derivations.scm (derivation-input-derivation): New procedure. (derivation-prerequisites): Use it.
This commit is contained in:
parent
74247b80e5
commit
2ef22a9f37
1 changed files with 6 additions and 3 deletions
|
@ -62,6 +62,7 @@ (define-module (guix derivations)
|
||||||
<derivation-input>
|
<derivation-input>
|
||||||
derivation-input?
|
derivation-input?
|
||||||
derivation-input-path
|
derivation-input-path
|
||||||
|
derivation-input-derivation
|
||||||
derivation-input-sub-derivations
|
derivation-input-sub-derivations
|
||||||
derivation-input-output-paths
|
derivation-input-output-paths
|
||||||
valid-derivation-input?
|
valid-derivation-input?
|
||||||
|
@ -152,6 +153,10 @@ (define-immutable-record-type <derivation-input>
|
||||||
(path derivation-input-path) ; store path
|
(path derivation-input-path) ; store path
|
||||||
(sub-derivations derivation-input-sub-derivations)) ; list of strings
|
(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>
|
(set-record-type-printer! <derivation>
|
||||||
(lambda (drv port)
|
(lambda (drv port)
|
||||||
(format port "#<derivation ~a => ~a ~a>"
|
(format port "#<derivation ~a => ~a ~a>"
|
||||||
|
@ -243,9 +248,7 @@ (define* (derivation-prerequisites drv #:optional (cut? (const #f)))
|
||||||
(fold2 loop
|
(fold2 loop
|
||||||
(append inputs result)
|
(append inputs result)
|
||||||
(fold set-insert input-set inputs)
|
(fold set-insert input-set inputs)
|
||||||
(map (lambda (i)
|
(map derivation-input-derivation inputs)))))
|
||||||
(read-derivation-from-file (derivation-input-path i)))
|
|
||||||
inputs)))))
|
|
||||||
|
|
||||||
(define (offloadable-derivation? drv)
|
(define (offloadable-derivation? drv)
|
||||||
"Return true if DRV can be offloaded, false otherwise."
|
"Return true if DRV can be offloaded, false otherwise."
|
||||||
|
|
Loading…
Reference in a new issue