substitute-binary: Don't pretend to report download progress on Guile 2.0.5.

* guix/scripts/substitute-binary.scm (progress-report-port): On Guile
  2.0.5, return PORT directly and emit a warning.
This commit is contained in:
Ludovic Courtès 2013-08-21 01:16:57 +02:00
parent 6facbc7590
commit db90b40dfd
1 changed files with 11 additions and 3 deletions

View File

@ -416,9 +416,17 @@ PORT. REPORT-PROGRESS is a two-argument procedure such as that returned by
;; XXX: We're not in control, so we always return anyway. ;; XXX: We're not in control, so we always return anyway.
n)) n))
(make-custom-binary-input-port "progress-port-proc" ;; Since `http-fetch' in Guile 2.0.5 returns all the data once it's done,
read! #f #f ;; don't pretend to report any progress in that case.
(cut close-port port))) (if (version>? (version) "2.0.5")
(make-custom-binary-input-port "progress-port-proc"
read! #f #f
(cut close-port port))
(begin
(format (current-error-port) (_ "Downloading, please wait...~%"))
(format (current-error-port)
(_ "(Please consider upgrading Guile to get proper progress report.)~%"))
port)))
(define %cache-url (define %cache-url
(or (getenv "GUIX_BINARY_SUBSTITUTE_URL") (or (getenv "GUIX_BINARY_SUBSTITUTE_URL")