From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: Alex Kost <alezost@gmail.com>
Cc: Guix-devel <guix-devel@gnu.org>, Federico Beffa <beffa@fbengineering.ch>
Subject: Re: [PATCH] Elpa importer improvements
Date: Tue, 27 Dec 2016 21:20:17 +1100 [thread overview]
Message-ID: <87o9zxad26.fsf@zancanaro.id.au> (raw)
In-Reply-To: <87ful9px9c.fsf@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 700 bytes --]
On Tue, Dec 27 2016, Alex Kost wrote
> [...]
>
>> - (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) + (apply throw key args)))))
>
> So here you fixed a regression introduced by commit 218622a73¹,
> thanks! I think it's better to call 'leave' on the last line as
> it was done originally.
Ah, so that's what it meant by "leave"! I misunderstood. I had
interpreted it as "leave the error alone", so thought re-throwing
was consistent with that. I've attached an updated patch to use
the original "leave" line.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-import-elpa-Fix-call-with-downloaded-file.patch --]
[-- Type: text/x-diff, Size: 1218 bytes --]
From 35da0d4977f217be6aefb24ab062b646d17de671 Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
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.
---
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
--- 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."
- (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)))))
(define (is-elpa-package? name elpa-pkg-spec)
"Return true if the string NAME corresponds to the name of the package
--
2.11.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
next prev parent reply other threads:[~2016-12-27 10:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 2:04 [PATCH] Elpa importer improvements Carlo Zancanaro
2016-12-23 1:57 ` Carlo Zancanaro
2016-12-27 8:54 ` Alex Kost
2016-12-27 10:20 ` Carlo Zancanaro [this message]
2016-12-29 17:16 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o9zxad26.fsf@zancanaro.id.au \
--to=carlo@zancanaro.id.au \
--cc=alezost@gmail.com \
--cc=beffa@fbengineering.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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.