summaryrefslogtreecommitdiff
path: root/tests/builders.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-14 14:42:10 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-14 14:42:10 +0100
commitf220a8384890b2a50f30c62fba56e507333f1a92 (patch)
treec51640dc8115aecb8f7b3ffc055f6b2e066d16f7 /tests/builders.scm
parent023d9892c0411adb523e6bc8337be3e7e94e606f (diff)
packages: Convert source derivations to monadic style.
* guix/packages.scm (origin->derivation): Take body from 'package-source-derivation', and change it to monadic style. Expect METHOD to a monadic procedure. (package-source-derivation): Define in terms of 'origin->derivation'. * guix/download.scm (url-fetch): Remove 'store' argument. Remove 'guile-for-build' variable. Turn into a monadic procedure. * guix/git-download.scm (git-fetch): Likewise. * guix/svn-download.scm (svn-fetch): Likewise. * tests/builders.scm (url-fetch*): New procedure. Change tests to call 'url-fetch*' instead of 'url-fetch'. * tests/packages.scm ("package-source-derivation, snippet"): Remove 'store' parameter of 'fetch' and change it to use 'interned-file' instead of 'add-to-store'. * gnu/packages/bootstrap.scm (bootstrap-origin)[boot]: Remove 'store' parameter.
Diffstat (limited to 'tests/builders.scm')
-rw-r--r--tests/builders.scm21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/builders.scm b/tests/builders.scm
index 579246d04d..e5acc3e038 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -59,6 +59,9 @@
(define network-reachable?
(false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)))
+(define url-fetch*
+ (store-lower url-fetch))
+
(test-begin "builders")
@@ -68,8 +71,8 @@
"ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
(hash (nix-base32-string->bytevector
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (drv (url-fetch %store url 'sha256 hash
- #:guile %bootstrap-guile))
+ (drv (url-fetch* %store url 'sha256 hash
+ #:guile %bootstrap-guile))
(out-path (derivation->output-path drv)))
(and (build-derivations %store (list drv))
(file-exists? out-path)
@@ -78,16 +81,16 @@
(test-assert "url-fetch, file"
(let* ((file (search-path %load-path "guix.scm"))
(hash (call-with-input-file file port-sha256))
- (out (url-fetch %store file 'sha256 hash)))
+ (out (url-fetch* %store file 'sha256 hash)))
(and (file-exists? out)
(valid-path? %store out))))
(test-assert "url-fetch, file URI"
(let* ((file (search-path %load-path "guix.scm"))
(hash (call-with-input-file file port-sha256))
- (out (url-fetch %store
- (string-append "file://" (canonicalize-path file))
- 'sha256 hash)))
+ (out (url-fetch* %store
+ (string-append "file://" (canonicalize-path file))
+ 'sha256 hash)))
(and (file-exists? out)
(valid-path? %store out))))
@@ -99,8 +102,8 @@
(let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
(hash (nix-base32-string->bytevector
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (tarball (url-fetch %store url 'sha256 hash
- #:guile %bootstrap-guile))
+ (tarball (url-fetch* %store url 'sha256 hash
+ #:guile %bootstrap-guile))
(build (gnu-build %store "hello-2.8"
`(("source" ,tarball)
,@%bootstrap-inputs)