unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ng0 <contact.ng0@cryptolab.net>
To: Tobias Geerinckx-Rice <me@tobias.gr>, guix-devel@gnu.org
Subject: Re: [PATCH 1/3] download: url-fetch/tarball: Make ‘name’ truly optional.
Date: Sat, 28 Jan 2017 18:22:55 +0000	[thread overview]
Message-ID: <87inozvybk.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <20170127195924.22959-1-me@tobias.gr>

I have tested if the changed packages still build, that's all:

Tobias Geerinckx-Rice <me@tobias.gr> writes:

> * 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’.

Builds…

> * gnu/packages/engineering.scm (fastcap)[source]: Likewise.

…same here

> * gnu/packages/scheme.scm (scmutils)[source]: Likewise.

…and here.

> ---
>
> Guix,
>
> This copies some code from ‘url-fetch’ to ‘url-fetch/tarbomb’, allowing
> the latter to be used without a mandatory ‘file-name’.
>
> Unless, of course, that was by design.
>
> I've made the same change to ‘url-fetch/zipbomb’ in the next patch. If
> there's a more tightly factored way to do this nicely, please let me know.
>
> Kind regards,
>
> T G-R
>
>  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 3bf3521..2d6cef2 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 <beffa@fbengineering.ch>
>  ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
>  ;;; Copyright © 2016 David Craven <david@craven.ch>
> +;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;;
>  ;;; 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"))
> -- 
> 2.9.3
>
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/

  parent reply	other threads:[~2017-01-28 18:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 19:59 [PATCH 1/3] download: url-fetch/tarball: Make ‘name’ truly optional Tobias Geerinckx-Rice
2017-01-27 19:59 ` [PATCH 2/3] download: Add ‘url-fetch/zipbomb’ Tobias Geerinckx-Rice
2017-01-28 17:55   ` ng0
2017-01-30 22:52   ` Ludovic Courtès
2017-01-27 19:59 ` [PATCH 3/3] gnu: Add zpaq Tobias Geerinckx-Rice
2017-01-28 17:51   ` ng0
2017-01-28 18:02     ` Tobias Geerinckx-Rice
2017-01-30 22:54   ` Ludovic Courtès
2017-01-30 23:12     ` Tobias Geerinckx-Rice
2017-01-28 18:22 ` ng0 [this message]
2017-01-30 22:51 ` [PATCH 1/3] download: url-fetch/tarball: Make ‘name’ truly optional Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87inozvybk.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me \
    --to=contact.ng0@cryptolab.net \
    --cc=guix-devel@gnu.org \
    --cc=me@tobias.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).