mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-23 19:19:20 -05:00
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
1 changed files with 14 additions and 7 deletions
|
@ -73,6 +73,7 @@ (define-module (guix derivations)
|
|||
derivation-name
|
||||
derivation-output-names
|
||||
fixed-output-derivation?
|
||||
fixed-output-path
|
||||
offloadable-derivation?
|
||||
substitutable-derivation?
|
||||
substitution-oracle
|
||||
|
@ -676,7 +677,11 @@ (define (output-path output hash name) ; makeOutputPath
|
|||
name
|
||||
(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
|
||||
HASH-ALGO, of the derivation NAME. RECURSIVE? has the same meaning as for
|
||||
'add-to-store'."
|
||||
|
@ -736,12 +741,14 @@ (define (add-output-paths drv)
|
|||
(outputs (map (match-lambda
|
||||
((output-name . ($ <derivation-output>
|
||||
_ algo hash rec?))
|
||||
(let ((path (if hash
|
||||
(fixed-output-path output-name
|
||||
algo hash
|
||||
rec? name)
|
||||
(output-path output-name
|
||||
drv-hash name))))
|
||||
(let ((path
|
||||
(if hash
|
||||
(fixed-output-path name hash
|
||||
#:hash-algo algo
|
||||
#:output output-name
|
||||
#:recursive? rec?)
|
||||
(output-path output-name
|
||||
drv-hash name))))
|
||||
(cons output-name
|
||||
(make-derivation-output path algo
|
||||
hash rec?)))))
|
||||
|
|
Loading…
Reference in a new issue