From 58f91e4d03e102058fc0f8a859cb144c40c6a1d0 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 27 Jan 2017 20:48:37 +0100 Subject: =?UTF-8?q?download:=20url-fetch/tarball:=20Make=20=E2=80=98name?= =?UTF-8?q?=E2=80=99=20truly=20optional.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/download.scm (url-fetch/tarbomb): Fall back to ‘file-name’ if ‘name’ is #f, like the regular ‘url-fetch’ does. * gnu/packages/bioinformatics.scm (muscle)[source]: Remove ‘file-name’. * gnu/packages/engineering.scm (fastcap)[source]: Likewise. * gnu/packages/scheme.scm (scmutils)[source]: Likewise. --- guix/download.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'guix/download.scm') diff --git a/guix/download.scm b/guix/download.scm index e2e5cee777..e218c2e264 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2016 David Craven +;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -485,17 +486,24 @@ in the store." (guile (default-guile))) "Similar to 'url-fetch' but unpack the file from URL in a directory of its own. This helper makes it easier to deal with \"tar bombs\"." + (define file-name + (match url + ((head _ ...) + (basename head)) + (_ + (basename url)))) (define gzip (module-ref (resolve-interface '(gnu packages compression)) 'gzip)) (define tar (module-ref (resolve-interface '(gnu packages base)) 'tar)) (mlet %store-monad ((drv (url-fetch url hash-algo hash - (string-append "tarbomb-" name) + (string-append "tarbomb-" + (or name file-name)) #:system system #:guile guile))) ;; Take the tar bomb, and simply unpack it as a directory. - (gexp->derivation name + (gexp->derivation (or name file-name) #~(begin (mkdir #$output) (setenv "PATH" (string-append #$gzip "/bin")) -- cgit v1.2.3