guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/07: download: url-fetch/tarball: Make ‘name’ truly optional.


From: Tobias Geerinckx-Rice
Subject: 05/07: download: url-fetch/tarball: Make ‘name’ truly optional.
Date: Wed, 1 Feb 2017 15:19:44 +0000 (UTC)

nckx pushed a commit to branch master
in repository guix.

commit 58f91e4d03e102058fc0f8a859cb144c40c6a1d0
Author: Tobias Geerinckx-Rice <address@hidden>
Date:   Fri Jan 27 20:48:37 2017 +0100

    download: url-fetch/tarball: Make ‘name’ truly optional.
    
    * 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.
---
 gnu/packages/bioinformatics.scm |    1 -
 gnu/packages/engineering.scm    |    1 -
 gnu/packages/scheme.scm         |    1 -
 guix/download.scm               |   12 ++++++++++--
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 79d479f..420bbc6 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3501,7 +3501,6 @@ that a read originated from a particular isoform.")
     (version "3.8.1551")
     (source (origin
               (method url-fetch/tarbomb)
-              (file-name (string-append name "-" version))
               (uri (string-append
                     "http://www.drive5.com/muscle/muscle_src_";
                     version ".tar.gz"))
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index b147764..734efcd 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -259,7 +259,6 @@ featuring various improvements and bug fixes.")))
     (version "2.0-18Sep92")
     (source (origin
               (method url-fetch/tarbomb)
-              (file-name (string-append name "-" version ".tar.gz"))
               (uri (string-append "http://www.rle.mit.edu/cpg/codes/";
                                   name "-" version ".tgz"))
               (sha256
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 2756805..1210ab5 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -604,7 +604,6 @@ threads.")
          (snippet
           ;; Remove binary code
           '(delete-file-recursively "scmutils/mit-scheme"))
-         (file-name (string-append name "-" version ".tar.gz"))
          (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946";
                              "/scmutils-tarballs/" name "-" version
                              "-x86-64-gnu-linux.tar.gz"))
diff --git a/guix/download.scm b/guix/download.scm
index e2e5cee..e218c2e 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015 Federico Beffa <address@hidden>
 ;;; Copyright © 2016 Alex Griffin <address@hidden>
 ;;; Copyright © 2016 David Craven <address@hidden>
+;;; Copyright © 2017 Tobias Geerinckx-Rice <address@hidden>
 ;;;
 ;;; 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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]