From e9b046fddaefbb98c931260821399090c221173d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 12 Jul 2016 00:56:37 +0200 Subject: 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. --- guix/download.scm | 57 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'guix/download.scm') 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 @@ (define need-gnutls? (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 @@ (define builder #: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 -- cgit v1.2.3