unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Craven <david@craven.ch>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH 01/12] upstream: Use a the first url from urls when find2 returns #f.
Date: Tue, 13 Dec 2016 23:22:03 +0100	[thread overview]
Message-ID: <87eg1bmpv8.fsf@gnu.org> (raw)
In-Reply-To: <CAL1_imnMrPYQngO0X1tET3CVfFsxsBk0JEq_Z1wwOq4OsEBMyw@mail.gmail.com> (David Craven's message of "Tue, 13 Dec 2016 21:07:19 +0100")

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

David Craven <david@craven.ch> skribis:

>> Thanks, and sorry for taking long for just one line!
>
> No problem. That's what code reviews are for...
>
> I removed my change and inserted
>        (display urls)
>        (display signature-urls)
>        (display url)
>        (display signature-url)
>
> here are the results:
>
> urls: (https://crates.io/api/v1/crates/libc/0.2.18/download)
> signature-urls: #f
> url: #f
> signature-url: #f

Got it.  What about this change:


[-- Attachment #2: Type: text/x-patch, Size: 1169 bytes --]

diff --git a/guix/upstream.scm b/guix/upstream.scm
index 8685afd..e069cc2 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -241,12 +241,16 @@ and 'interactive' (default)."
                    ((archive-type)
                     (match (and=> (package-source package) origin-uri)
                       ((? string? uri)
-                       (or (file-extension uri) "gz"))
+                       (file-extension uri))
                       (_
                        "gz")))
                    ((url signature-url)
                     (find2 (lambda (url sig-url)
-                             (string-suffix? archive-type url))
+                             ;; Some URIs lack a file extension, like
+                             ;; 'https://crates.io/…/0.1/download'.  In that
+                             ;; case, pick the first URL.
+                             (or (not archive-type)
+                                 (string-suffix? archive-type url)))
                            urls
                            (or signature-urls (circular-list #f)))))
        (let ((tarball (download-tarball store url signature-url

[-- Attachment #3: Type: text/plain, Size: 181 bytes --]


?

The root cause was that the thing would expect a “gz” extension when it
couldn’t find an extension.

If that works for you, feel free to push!

Thanks,
Ludo’.

  reply	other threads:[~2016-12-13 22:22 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 17:25 [PATCH 00/12] Rust build system v2 David Craven
2016-12-11 17:25 ` [PATCH 01/12] upstream: Use a the first url from urls when find2 returns #f David Craven
2016-12-13 17:25   ` Ludovic Courtès
2016-12-13 20:07     ` David Craven
2016-12-13 22:22       ` Ludovic Courtès [this message]
2016-12-11 17:25 ` [PATCH 02/12] build-system: Add cargo build system David Craven
2016-12-13 17:26   ` Ludovic Courtès
2016-12-30 11:08   ` Danny Milosavljevic
2017-01-01 14:42     ` David Craven
2016-12-11 17:25 ` [PATCH 03/12] import: utils: Add some utilities David Craven
2016-12-13 17:29   ` Ludovic Courtès
2016-12-13 18:09     ` David Craven
2016-12-11 17:25 ` [PATCH 04/12] import: Add importer for rust crates David Craven
2016-12-13 17:30   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 05/12] import: Add updater " David Craven
2016-12-13 17:30   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 06/12] gnu: llvm: Enable install utils David Craven
2016-12-13 22:50   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 07/12] gnu: Add rust bootstrap binaries David Craven
2016-12-13 22:44   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 08/12] gnu: Add rustc David Craven
2016-12-13 22:47   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 09/12] gnu: Add rust-libc David Craven
2016-12-13 22:48   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 10/12] RECURSIVE IMPORTER wip David Craven
2016-12-13 22:49   ` Ludovic Courtès
2016-12-11 17:25 ` [PATCH 11/12] gnu: Add rust-rand David Craven
2016-12-13 22:50   ` Ludovic Courtès
2017-01-03  0:52   ` Danny Milosavljevic
2016-12-11 17:25 ` [PATCH 12/12] gnu: Add cargo David Craven
2016-12-13 22:51   ` 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=87eg1bmpv8.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /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).