From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wMHRC7yoGl/bDQAA0tVLHw (envelope-from ) for ; Fri, 24 Jul 2020 09:24:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YP6jB7yoGl9oXQAA1q6Kng (envelope-from ) for ; Fri, 24 Jul 2020 09:24:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BEB5E9400C3 for ; Fri, 24 Jul 2020 09:24:11 +0000 (UTC) Received: from localhost ([::1]:50556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jytw2-0006nh-Nm for larch@yhetil.org; Fri, 24 Jul 2020 05:24:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jytvu-0006jY-8u for bug-guix@gnu.org; Fri, 24 Jul 2020 05:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jytvt-0005wM-VY for bug-guix@gnu.org; Fri, 24 Jul 2020 05:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jytvt-0001Mv-QZ for bug-guix@gnu.org; Fri, 24 Jul 2020 05:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42504: guix refresh --update fails for Rust packages Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 24 Jul 2020 09:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42504 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Alexandru-Sergiu Marton Received: via spool by 42504-submit@debbugs.gnu.org id=B42504.15955826135225 (code B ref 42504); Fri, 24 Jul 2020 09:24:01 +0000 Received: (at 42504) by debbugs.gnu.org; 24 Jul 2020 09:23:33 +0000 Received: from localhost ([127.0.0.1]:46732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jytvR-0001MD-90 for submit@debbugs.gnu.org; Fri, 24 Jul 2020 05:23:33 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:34034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jytvP-0001M5-RB for 42504@debbugs.gnu.org; Fri, 24 Jul 2020 05:23:32 -0400 Received: from localhost (unknown [212.183.16.185]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 219013365982; Fri, 24 Jul 2020 11:23:31 +0200 (CEST) Date: Fri, 24 Jul 2020 11:23:30 +0200 From: Danny Milosavljevic Message-ID: <20200724112330.4891eb0a@scratchpost.org> In-Reply-To: <87r1t11iym.fsf@posteo.ro> References: <87r1t11iym.fsf@posteo.ro> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/D330t_=mAMcITdVL3j6Z8JJ"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 42504@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.11 X-TUID: Yhveg3SFeVkP --Sig_/D330t_=mAMcITdVL3j6Z8JJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable '"z"' appears in guix/upstream.scm,=20 (define* (package-update/url-fetch store package source #:key key-download) "Return the version, tarball, and SOURCE, to update PACKAGE to SOURCE, an ." (match source (($ _ version urls signature-urls) (let*-values (((archive-type) (match (and=3D> (package-source package) origin-uri) ((? string? uri) (let ((type (file-extension (basename uri)))) ;; Sometimes we have URLs such as ;; "https://github.com/=E2=80=A6/tarball/v0.1", in= which case ;; we must not consider "1" as the extension. (and (or (string-contains type "z") (string=3D? type "tar")) type))) (_ "gz"))) ((url signature-url) ;; Try to find a URL that matches ARCHIVE-TYPE. (find2 (lambda (url sig-url) ;; Some URIs lack a file extension, like ;; 'https://crates.io/???/0.1/download'. In t= hat ;; case, pick the first URL. (or (not archive-type) (string-suffix? archive-type url))) urls (or signature-urls (circular-list #f))))) ;; If none of URLS matches ARCHIVE-TYPE, then URL is #f; in that cas= e, ;; pick up the first element of URLS. (let ((tarball (download-tarball store (or url (first urls)) (and (pair? signature-urls) (or signature-url (first signature-urls))) #:key-download key-download))) (values version tarball source)))))) And guix repl says: scheme@(guix-user)> ,use (guix utils) scheme@(guix-user)> (file-extension "https://crates.io/api/v1/crates/instan= t/0.1.2/download") $1 =3D #f But the case #f is not handled in the code above--which is why it doesn't w= ork. Could you test the following fix? diff --git a/guix/upstream.scm b/guix/upstream.scm index 70cbfb45e8..31bd6faea4 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -369,7 +369,7 @@ SOURCE, an ." (let*-values (((archive-type) (match (and=3D> (package-source package) origin-uri) ((? string? uri) - (let ((type (file-extension (basename uri)))) + (let ((type (or (file-extension (basename uri)) "")= )) ;; Sometimes we have URLs such as ;; "https://github.com/=E2=80=A6/tarball/v0.1", i= n which case ;; we must not consider "1" as the extension. --Sig_/D330t_=mAMcITdVL3j6Z8JJ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl8aqJIACgkQ5xo1VCww uqWJ9AgAn1VXyioJGFWDOlArjGZOQ/EVGeKzbLQcX1vLjNAZoY5dHYTdKrIfZAPP BT9kc7o6oJ+XylyjTGy3StDY/tyv8pM53BUqE7h5ggzAn0AZbZc2p9m0eIykFrED YlRIs1eoFDw9l/7rsctt0rbUCjepZ95e8EYLVmq1PkzAHlRjuoTerVwYabh5dQMg cEg/fXPLJRyIBGG6lDQ+etHabktdK1uTiWUEDzZLJSJnYnI0KGRjG/0AQqXxgCI9 MD2VQ0NMjI65qfTmrxZO1NmvQ7HoUqD+39C3NVSUIi1CM23VASjDQUrrJLQcGSxY p0+60uPqLPZW1eSgU5hRGhfh3Sx6Jw== =ncy5 -----END PGP SIGNATURE----- --Sig_/D330t_=mAMcITdVL3j6Z8JJ--