From fb3eec8301e3f41f14a51a114cff88dc0e24cfc2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 5 Jun 2012 00:04:07 +0200 Subject: Test the `build-derivations' operation. * guix/derivations.scm (derivation): Return DRV as a second value. * tests/derivations.scm ("build derivation with 1 source"): New test. --- guix/derivations.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'guix/derivations.scm') diff --git a/guix/derivations.scm b/guix/derivations.scm index 5ad9f49c00..b13664ce05 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -250,7 +250,7 @@ the derivation called NAME with hash HASH." (define* (derivation store name system builder args env-vars inputs #:key (outputs '("out")) hash hash-algo hash-mode) "Build a derivation with the given arguments. Return the resulting - object and its store path. When HASH, HASH-ALGO, and HASH-MODE +store path and object. When HASH, HASH-ALGO, and HASH-MODE are given, a fixed-output derivation is created---i.e., one whose result is known in advance, such as a file download." (define (add-output-paths drv) @@ -321,8 +321,9 @@ known in advance, such as a file download." inputs) system builder args env-vars)) (drv (add-output-paths drv-masked))) - (add-text-to-store store (string-append name ".drv") - (call-with-output-string - (cut write-derivation drv <>)) - (map derivation-input-path - inputs)))) + (values (add-text-to-store store (string-append name ".drv") + (call-with-output-string + (cut write-derivation drv <>)) + (map derivation-input-path + inputs)) + drv))) -- cgit v1.2.3