From 7262619d6fa570fa47228daaead1b0473914c069 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 5 May 2021 23:10:25 -0400 Subject: download: Restore error reporting. Normal error reporting was disrupted by the introduction of Disarchive in commit fbc2a52a32ddc664db8ebab420c2e17b1432c744. In particular, running 'guix download' would succeed with a partially downloaded file. * guix/build/download.scm (disarchive-fetch/any): Return '#f' when Disarchive cannot be found, the specification cannot be found, or Disarchive fails due to an error. --- guix/build/download.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'guix/build') diff --git a/guix/build/download.scm b/guix/build/download.scm index ce31038b05..b14db42352 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -662,14 +662,15 @@ (define (resolve addresses output) (lambda (disarchive) (cons (module-ref disarchive '%disarchive-log-port) (module-ref disarchive 'disarchive-assemble)))) - (#f - (format #t "could not load Disarchive~%")) + (#f (format #t "could not load Disarchive~%") + #f) ((%disarchive-log-port . disarchive-assemble) (match (fetch-specification uris) - (#f - (format #t "could not find its Disarchive specification~%")) + (#f (format #t "could not find its Disarchive specification~%") + #f) (spec (parameterize ((%disarchive-log-port (current-output-port))) - (disarchive-assemble spec file #:resolver resolve))))))) + (false-if-exception* + (disarchive-assemble spec file #:resolver resolve)))))))) (define* (url-fetch url file #:key -- cgit v1.2.3