diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-04-26 16:43:08 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-04-26 16:43:08 +0200 |
commit | a9db7d10b6e4e86fb2b87a4161db3b1f202002fd (patch) | |
tree | 4a22481ab65447d8bc1cc307a76a884a7e7bbee9 /guix/download.scm | |
parent | e33d9d6f09874f83bb5a03f49cb969a84588e10e (diff) | |
parent | 2b6bdf7eb3c95716ac107ea6caea2e0b7077ae77 (diff) | |
download | gnu-guix-a9db7d10b6e4e86fb2b87a4161db3b1f202002fd.tar gnu-guix-a9db7d10b6e4e86fb2b87a4161db3b1f202002fd.tar.gz |
Merge branch 'master' into core-updates
Conflicts:
Makefile.am
gnu/packages/autotools.scm
gnu/packages/guile.scm
gnu/packages/python.scm
gnu/packages/shishi.scm
guix/gnu-maintenance.scm
guix/scripts/build.scm
guix/scripts/gc.scm
guix/scripts/package.scm
guix/scripts/substitute-binary.scm
guix/ui.scm
nix/nix-daemon/guix-daemon.cc
test-env.in
tests/nar.scm
tests/store.scm
Diffstat (limited to 'guix/download.scm')
-rw-r--r-- | guix/download.scm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/guix/download.scm b/guix/download.scm index 689920c3e0..99353be8b0 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -21,13 +21,15 @@ #:use-module (ice-9 match) #:use-module (guix derivations) #:use-module (guix packages) - #:use-module ((guix store) #:select (derivation-path?)) + #:use-module ((guix store) #:select (derivation-path? add-to-store)) + #:use-module ((guix build download) #:renamer (symbol-prefix-proc 'build:)) #:use-module (guix utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) #:export (%mirrors - url-fetch)) + url-fetch + download-to-store)) ;;; Commentary: ;;; @@ -230,4 +232,17 @@ must be a list of symbol/URL-list pairs." #:guile-for-build guile-for-build #:env-vars env-vars))) +(define* (download-to-store store url #:optional (name (basename url)) + #:key (log (current-error-port))) + "Download from URL to STORE, either under NAME or URL's basename if +omitted. Write progress reports to LOG." + (call-with-temporary-output-file + (lambda (temp port) + (let ((result + (parameterize ((current-output-port log)) + (build:url-fetch url temp #:mirrors %mirrors)))) + (close port) + (and result + (add-to-store store name #f "sha256" temp)))))) + ;;; download.scm ends here |