derivations: Export 'fixed-output-path'.
* guix/derivations.scm (fixed-output-path): Change 'output', 'hash-algo', and 'recursive?' to keyword parameters. Export. (derivation): Adjust accordingly.
This commit is contained in:
parent
a849273509
commit
260bc60f83
|
@ -73,6 +73,7 @@
|
||||||
derivation-name
|
derivation-name
|
||||||
derivation-output-names
|
derivation-output-names
|
||||||
fixed-output-derivation?
|
fixed-output-derivation?
|
||||||
|
fixed-output-path
|
||||||
offloadable-derivation?
|
offloadable-derivation?
|
||||||
substitutable-derivation?
|
substitutable-derivation?
|
||||||
substitution-oracle
|
substitution-oracle
|
||||||
|
@ -676,7 +677,11 @@ the derivation called NAME with hash HASH."
|
||||||
name
|
name
|
||||||
(string-append name "-" output))))
|
(string-append name "-" output))))
|
||||||
|
|
||||||
(define (fixed-output-path output hash-algo hash recursive? name)
|
(define* (fixed-output-path name hash
|
||||||
|
#:key
|
||||||
|
(output "out")
|
||||||
|
(hash-algo 'sha256)
|
||||||
|
(recursive? #t))
|
||||||
"Return an output path for the fixed output OUTPUT defined by HASH of type
|
"Return an output path for the fixed output OUTPUT defined by HASH of type
|
||||||
HASH-ALGO, of the derivation NAME. RECURSIVE? has the same meaning as for
|
HASH-ALGO, of the derivation NAME. RECURSIVE? has the same meaning as for
|
||||||
'add-to-store'."
|
'add-to-store'."
|
||||||
|
@ -736,10 +741,12 @@ output should not be used."
|
||||||
(outputs (map (match-lambda
|
(outputs (map (match-lambda
|
||||||
((output-name . ($ <derivation-output>
|
((output-name . ($ <derivation-output>
|
||||||
_ algo hash rec?))
|
_ algo hash rec?))
|
||||||
(let ((path (if hash
|
(let ((path
|
||||||
(fixed-output-path output-name
|
(if hash
|
||||||
algo hash
|
(fixed-output-path name hash
|
||||||
rec? name)
|
#:hash-algo algo
|
||||||
|
#:output output-name
|
||||||
|
#:recursive? rec?)
|
||||||
(output-path output-name
|
(output-path output-name
|
||||||
drv-hash name))))
|
drv-hash name))))
|
||||||
(cons output-name
|
(cons output-name
|
||||||
|
|
Loading…
Reference in New Issue