guix build: Catch 'getaddrinfo-error' for '--log-file'.

* guix/scripts/build.scm (log-url)[valid-url?]: Catch
'getaddrinfo-error'.
master
Ludovic Courtès 2016-05-14 16:56:21 +02:00
parent 6e94a57478
commit c22a475725
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 3 deletions

View File

@ -65,9 +65,13 @@
found. Return #f if no build log was found." found. Return #f if no build log was found."
(define (valid-url? url) (define (valid-url? url)
;; Probe URL and return #t if it is accessible. ;; Probe URL and return #t if it is accessible.
(guard (c ((http-get-error? c) #f)) (catch 'getaddrinfo-error
(close-port (http-fetch url #:buffered? #f)) (lambda ()
#t)) (guard (c ((http-get-error? c) #f))
(close-port (http-fetch url #:buffered? #f))
#t))
(lambda _
#f)))
(define (find-url file) (define (find-url file)
(let ((base (basename file))) (let ((base (basename file)))