From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) 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 Message-ID: <87eg1bmpv8.fsf@gnu.org> References: <20161211172537.23315-1-david@craven.ch> <20161211172537.23315-2-david@craven.ch> <87zijzrbap.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGvSd-0004fC-GB for guix-devel@gnu.org; Tue, 13 Dec 2016 17:22:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGvSZ-0007hH-Er for guix-devel@gnu.org; Tue, 13 Dec 2016 17:22:11 -0500 In-Reply-To: (David Craven's message of "Tue, 13 Dec 2016 21:07:19 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel --=-=-= Content-Type: text/plain David Craven 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: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=3D> (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/=E2=80=A6/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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ? The root cause was that the thing would expect a =E2=80=9Cgz=E2=80=9D exten= sion when it couldn=E2=80=99t find an extension. If that works for you, feel free to push! Thanks, Ludo=E2=80=99. --=-=-=--