aboutsummaryrefslogtreecommitdiff
path: root/guix/download.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-07-12 00:56:37 +0200
committerLudovic Courtès <ludo@gnu.org>2016-07-12 22:47:08 +0200
commite9b046fddaefbb98c931260821399090c221173d (patch)
tree1e501224782d9ff2c2dcd15c4765c827822bd331 /guix/download.scm
parent99b231dee663ce097e56108daacf24310f6c1078 (diff)
downloadgnu-guix-e9b046fddaefbb98c931260821399090c221173d.tar
gnu-guix-e9b046fddaefbb98c931260821399090c221173d.tar.gz
download: Use 'with-imported-modules'.
* guix/cvs-download.scm (cvs-fetch): Use 'with-imported-modules' instead of the #:modules argument of 'gexp->derivation'. * guix/download.scm (url-fetch): Likewise. * guix/git-download.scm (git-fetch): Likewise. * guix/hg-download.scm (hg-fetch): Likewise. * guix/svn-download.scm (svn-fetch): Likewise.
Diffstat (limited to 'guix/download.scm')
-rw-r--r--guix/download.scm57
1 files changed, 29 insertions, 28 deletions
diff --git a/guix/download.scm b/guix/download.scm
index c75a655925..336bc541e0 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -286,33 +286,39 @@ in the store."
(any https? url)))))
(define builder
- #~(begin
- #+(if need-gnutls?
+ (with-imported-modules '((guix build download)
+ (guix build utils)
+ (guix ftp-client)
+ (guix base32)
+ (guix base64))
+ #~(begin
+ #+(if need-gnutls?
- ;; Add GnuTLS to the inputs and to the load path.
- #~(eval-when (load expand eval)
- (set! %load-path
- (cons (string-append #+(gnutls-package)
- "/share/guile/site/"
- (effective-version))
- %load-path)))
- #~#t)
+ ;; Add GnuTLS to the inputs and to the load path.
+ #~(eval-when (load expand eval)
+ (set! %load-path
+ (cons (string-append #+(gnutls-package)
+ "/share/guile/site/"
+ (effective-version))
+ %load-path)))
+ #~#t)
- (use-modules (guix build download)
- (guix base32))
+ (use-modules (guix build download)
+ (guix base32))
- (let ((value-from-environment (lambda (variable)
- (call-with-input-string
- (getenv variable)
- read))))
- (url-fetch (value-from-environment "guix download url")
- #$output
- #:mirrors (call-with-input-file #$%mirror-file read)
+ (let ((value-from-environment (lambda (variable)
+ (call-with-input-string
+ (getenv variable)
+ read))))
+ (url-fetch (value-from-environment "guix download url")
+ #$output
+ #:mirrors (call-with-input-file #$%mirror-file read)
- ;; Content-addressed mirrors.
- #:hashes (value-from-environment "guix download hashes")
- #:content-addressed-mirrors
- (primitive-load #$%content-addressed-mirror-file)))))
+ ;; Content-addressed mirrors.
+ #:hashes
+ (value-from-environment "guix download hashes")
+ #:content-addressed-mirrors
+ (primitive-load #$%content-addressed-mirror-file))))))
(let ((uri (and (string? url) (string->uri url))))
(if (or (and (string? url) (not uri))
@@ -325,11 +331,6 @@ in the store."
#:system system
#:hash-algo hash-algo
#:hash hash
- #:modules '((guix build download)
- (guix build utils)
- (guix ftp-client)
- (guix base32)
- (guix base64))
;; Use environment variables and a fixed script
;; name so there's only one script in store for