From e509d1527d231b6460a20762e13b57cba2e43485 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 20 Jan 2013 22:17:58 +0100 Subject: packages: Have `package-derivation' return a as a second value. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/packages.scm (cache): Change the `drv' argument to `thunk'. Memoize all the return values of THUNK. (cached-derivation): Remove. (cached): New macro. (package-derivation): Use `cached' instead of `(or (cached-derivation) …)'. * doc/guix.texi (Defining Packages): Update accordingly. --- tests/packages.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/packages.scm b/tests/packages.scm index ea0df511d2..990deb79ef 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012 Ludovic Courtès +;;; Copyright © 2012, 2013 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +27,7 @@ #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages bootstrap) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) #:use-module (srfi srfi-64) #:use-module (rnrs io ports) @@ -70,7 +71,13 @@ ("d" ,d) ("d/x" "something.drv")) (pk 'x (package-transitive-inputs e)))))) -(test-skip (if (not %store) 2 0)) +(test-skip (if (not %store) 3 0)) + +(test-assert "return values" + (let-values (((drv-path drv) + (package-derivation %store (dummy-package "p")))) + (and (derivation-path? drv-path) + (derivation? drv)))) (test-assert "trivial" (let* ((p (package (inherit (dummy-package "trivial")) -- cgit v1.2.3