diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-06-11 11:19:12 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-06-11 11:19:12 +0200 |
commit | a43b55f1a6fa0eb712b2610b86a1775383d3f2cd (patch) | |
tree | 8ba275e9d4be71a34238d83c8fff919817c21e70 /guix/download.scm | |
parent | c2590362ad7c926050db0ea1dacd437027241520 (diff) | |
download | gnu-guix-a43b55f1a6fa0eb712b2610b86a1775383d3f2cd.tar gnu-guix-a43b55f1a6fa0eb712b2610b86a1775383d3f2cd.tar.gz |
guix build: Allow directories to be passed to --with-source.
* guix/scripts/build.scm (package-with-source)[tarball-base-name]: Gracefully
handle file names that lack an extension.
Pass #:recursive? #t to 'download-to-store'.
* guix/download.scm (download-to-store): Add #:recursive? parameter and pass
it to 'add-to-store'.
* doc/guix.texi (Invoking guix build): Add an example of --with-source with a
directory.
Diffstat (limited to 'guix/download.scm')
-rw-r--r-- | guix/download.scm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/guix/download.scm b/guix/download.scm index 6b0349402a..3f7f7badce 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -282,14 +282,15 @@ in the store." ))))) (define* (download-to-store store url #:optional (name (basename url)) - #:key (log (current-error-port))) + #:key (log (current-error-port)) recursive?) "Download from URL to STORE, either under NAME or URL's basename if -omitted. Write progress reports to LOG." +omitted. Write progress reports to LOG. RECURSIVE? has the same effect as +the same-named parameter of 'add-to-store'." (define uri (string->uri url)) (if (or (not uri) (memq (uri-scheme uri) '(file #f))) - (add-to-store store name #f "sha256" + (add-to-store store name recursive? "sha256" (if uri (uri-path uri) url)) (call-with-temporary-output-file (lambda (temp port) @@ -298,6 +299,6 @@ omitted. Write progress reports to LOG." (build:url-fetch url temp #:mirrors %mirrors)))) (close port) (and result - (add-to-store store name #f "sha256" temp))))))) + (add-to-store store name recursive? "sha256" temp))))))) ;;; download.scm ends here |