summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-09 23:33:42 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-09 23:36:24 +0100
commit0b6af195fe7476a15e498b24c67f9d8f6080a400 (patch)
tree9dee9e88c426a9f59b42606771fe051ab5a93d70 /guix
parenteb9dfcb3c4c5a3de7548afc35c7a3344f820c478 (diff)
derivations: Add 'derivation-output-names'.
* guix/derivations.scm (derivation-output-names): New procedure. (derivation-prerequisites-to-build): Use it for #:outputs. (map-derivation): Likewise. * tests/derivations.scm ("derivation-output-names"): New test.
Diffstat (limited to 'guix')
-rw-r--r--guix/derivations.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 69cef1a4cd..5e96d9fa3c 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -58,6 +58,7 @@
derivation-input-output-paths
derivation-name
+ derivation-output-names
fixed-output-derivation?
offloadable-derivation?
substitutable-derivation?
@@ -135,6 +136,12 @@
(let ((base (store-path-package-name (derivation-file-name drv))))
(string-drop-right base 4)))
+(define (derivation-output-names drv)
+ "Return the names of the outputs of DRV."
+ (match (derivation-outputs drv)
+ (((names . _) ...)
+ names)))
+
(define (fixed-output-derivation? drv)
"Return #t if DRV is a fixed-output derivation, such as the result of a
download with a fixed hash (aka. `fetchurl')."
@@ -180,9 +187,7 @@ download with a fixed hash (aka. `fetchurl')."
(define* (derivation-prerequisites-to-build store drv
#:key
(outputs
- (map
- car
- (derivation-outputs drv)))
+ (derivation-output-names drv))
(use-substitutes? #t))
"Return two values: the list of derivation-inputs required to build the
OUTPUTS of DRV and not already available in STORE, recursively, and the list
@@ -844,7 +849,7 @@ recursively."
replacements))))
(derivation-builder-environment-vars drv))
#:inputs (append (map list sources) inputs)
- #:outputs (map car (derivation-outputs drv))
+ #:outputs (derivation-output-names drv)
#:hash (match (derivation-outputs drv)
((($ <derivation-output> _ algo hash))
hash)