guix-commits
[Top][All Lists]
Advanced

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

02/04: derivations: Export 'fixed-output-path'.


From: Ludovic Courtès
Subject: 02/04: derivations: Export 'fixed-output-path'.
Date: Wed, 20 Jul 2016 15:11:22 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 260bc60f83b1955ac7f48b71872d3d2809132ee2
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jul 20 16:39:19 2016 +0200

    derivations: Export 'fixed-output-path'.
    
    * guix/derivations.scm (fixed-output-path): Change 'output',
    'hash-algo', and 'recursive?' to keyword parameters.  Export.
    (derivation): Adjust accordingly.
---
 guix/derivations.scm |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index 76593f3..7f74ed6 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -73,6 +73,7 @@
             derivation-name
             derivation-output-names
             fixed-output-derivation?
+            fixed-output-path
             offloadable-derivation?
             substitutable-derivation?
             substitution-oracle
@@ -676,7 +677,11 @@ the derivation called NAME with hash HASH."
                   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 @@ output should not be used."
               (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?)))))



reply via email to

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