diff mbox

[01/12] upstream: Use a the first url from urls when find2 returns #f.

Message ID 20161211172537.23315-2-david@craven.ch
State New
Headers show

Commit Message

David Craven Dec. 11, 2016, 5:25 p.m. UTC
* guix/upstream.scm (package-update): Use a url from the list when the
  find2 procedure doesn't find a url sig-url pair.
---
 guix/upstream.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ludovic Courtès Dec. 13, 2016, 5:25 p.m. UTC | #1
David Craven <david@craven.ch> skribis:

> * guix/upstream.scm (package-update): Use a url from the list when the
>   find2 procedure doesn't find a url sig-url pair.
> ---
>  guix/upstream.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/guix/upstream.scm b/guix/upstream.scm
> index 8685afd86..579942672 100644
> --- a/guix/upstream.scm
> +++ b/guix/upstream.scm
> @@ -249,7 +249,7 @@ and 'interactive' (default)."
>                               (string-suffix? archive-type url))
>                             urls
>                             (or signature-urls (circular-list #f)))))
> -       (let ((tarball (download-tarball store url signature-url
> +       (let ((tarball (download-tarball store (if url url (car urls)) signature-url

Please make it (or url (first urls)).

Could it be that commit 8d5d06282e255557d3bdda1794bd3fea2c84ff59 made it
moot?  What are the faulty values for ‘urls’ and ‘signature-urls’ that
trigger the problem?

Thanks, and sorry for taking long for just one line!

Ludo’.
David Craven Dec. 13, 2016, 8:07 p.m. UTC | #2
> 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

Backtrace:
In ice-9/boot-9.scm:
 157: 19 [catch #t #<catch-closure 24a64a0> ...]
In unknown file:
   ?: 18 [apply-smob/1 #<catch-closure 24a64a0>]
In ice-9/boot-9.scm:
  63: 17 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 16 [eval # #]
In ice-9/boot-9.scm:
2401: 15 [save-module-excursion #<procedure 24c7940 at
ice-9/boot-9.scm:4045:3 ()>]
4050: 14 [#<procedure 24c7940 at ice-9/boot-9.scm:4045:3 ()>]
1724: 13 [%start-stack load-stack ...]
1729: 12 [#<procedure 24ddcf0 ()>]
In unknown file:
   ?: 11 [primitive-load "/home/dvc/guix/scripts/guix"]
In guix/ui.scm:
1222: 10 [run-guix-command refresh "-u" "rust-libc"]
In ice-9/boot-9.scm:
 157: 9 [catch srfi-34 #<procedure 6ddaa20 at guix/ui.scm:426:2 ()> ...]
 157: 8 [catch system-error ...]
In guix/scripts/refresh.scm:
 442: 7 [#<procedure 6c523c0 at guix/scripts/refresh.scm:441:4 ()>]
 454: 6 [#<procedure 6c72d80 at guix/scripts/refresh.scm:442:6 ()>]
In srfi/srfi-1.scm:
 619: 5 [for-each #<procedure 6c65c00 at
guix/scripts/refresh.scm:455:15 (t-22335)> ...]
In guix/scripts/refresh.scm:
 263: 4 [update-package # # # ...]
In ice-9/eval.scm:
 411: 3 [eval # #]
 411: 2 [eval # #]
In guix/download.scm:
 507: 1 [download-to-store #<build-daemon 256.15 6c65cc0> #f ...]
In unknown file:
   ?: 0 [basename #f #<undefined>]

ERROR: In procedure basename:
ERROR: In procedure scm_to_utf8_stringn: Wrong type argument in
position 1 (expecting string): #f
diff mbox

Patch

diff --git a/guix/upstream.scm b/guix/upstream.scm
index 8685afd86..579942672 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -249,7 +249,7 @@  and 'interactive' (default)."
                              (string-suffix? archive-type url))
                            urls
                            (or signature-urls (circular-list #f)))))
-       (let ((tarball (download-tarball store url signature-url
+       (let ((tarball (download-tarball store (if url url (car urls)) signature-url
                                         #:key-download key-download)))
          (values version tarball))))
     (#f