From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: Re: [PATCH] Elpa importer improvements Date: Tue, 27 Dec 2016 21:20:17 +1100 Message-ID: <87o9zxad26.fsf@zancanaro.id.au> References: <8760mn5kqq.fsf@zancanaro.id.au> <87ful9px9c.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLosP-0004DO-3o for guix-devel@gnu.org; Tue, 27 Dec 2016 05:21:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLosO-0004lX-9F for guix-devel@gnu.org; Tue, 27 Dec 2016 05:21:01 -0500 In-reply-to: <87ful9px9c.fsf@gmail.com> 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: Alex Kost Cc: Guix-devel , Federico Beffa --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On Tue, Dec 27 2016, Alex Kost wrote > [...] >=20 >> - (proc (http-fetch/cached (string->uri url)))) + (catch #t +=20 >> (lambda () + (proc (http-fetch/cached (string->uri url))))=20 >> + (lambda (key . args) + (if error-thunk +=20 >> (error-thunk) + (apply throw key args))))) > > So here you fixed a regression introduced by commit 218622a73=C2=B9,=20 > thanks! I think it's better to call 'leave' on the last line as=20 > it was done originally. Ah, so that's what it meant by "leave"! I misunderstood. I had=20 interpreted it as "leave the error alone", so thought re-throwing=20 was consistent with that. I've attached an updated patch to use=20 the original "leave" line. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-import-elpa-Fix-call-with-downloaded-file.patch Content-Transfer-Encoding: quoted-printable From=2035da0d4977f217be6aefb24ab062b646d17de671 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 14 Dec 2016 12:31:12 +1100 Subject: [PATCH 1/2] import: elpa: Fix call-with-downloaded-file * guix/import/elpa.scm (call-with-downloaded-file): Make function behaviour match documentation string. =2D-- guix/import/elpa.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 320a09e8c..ec232cd8a 100644 =2D-- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -89,7 +89,13 @@ NAMES (strings)." "Fetch URL, store the content in a temporary file and call PROC with that file. Returns the value returned by PROC. On error call ERROR-THUNK and return its value or leave if it's false." =2D (proc (http-fetch/cached (string->uri url)))) + (catch #t + (lambda () + (proc (http-fetch/cached (string->uri url)))) + (lambda (key . args) + (if error-thunk + (error-thunk) + (leave (_ "~A: download failed~%") url))))) =20 (define (is-elpa-package? name elpa-pkg-spec) "Return true if the string NAME corresponds to the name of the package =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJYYkBhAAoJEMBVJci7YG0r/1cH/2SHAw1E2ec53M1Y3nqZP2+N VFIV1wTNdI9RqkREqEq+mWuHaFtXG8Jfjj3bEQHEV89XwF59JUOENd1NSZoPCwdb /yIYrYvJb+0KSyfDd/g6HJt1qr7CeRgCTcuspAzpfzpWtqZxD5S66pprzUY60GK+ 6nxA46RFXbNXcLSwiDh92faAVIz6ry80J7sebeh01oUIz1aTIy3RTdDIQOU6ouwX b/130GSOTC/9koClhx9+y81Aa9wzwv3q2yyPWh29b8KNnE4jB8Shxm1lpoXy4olB pZjlcahgGZiEceIABIy5JaQ5MGe/myuQ6jdZSgWO48WVsgjK9vhTZElx3WswDT0= =l2ti -----END PGP SIGNATURE----- --==-=-=--