mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
progress: Generate valid 'download-progress' traces when the size is unknown.
Fixes <https://bugs.gnu.org/32895>. Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/progress.scm (progress-reporter/trace): In 'stop', make sure SIZE is an integer. Previously we'd generate a "@ download-progress" trace with #f for the 'transferred' number when downloading files whose size is not known in advance.
This commit is contained in:
parent
ff30bb010b
commit
1d0be47ab6
1 changed files with 6 additions and 6 deletions
|
@ -304,12 +304,12 @@ (define message
|
|||
log-port)))
|
||||
(report (rate-limited report-progress %progress-interval))
|
||||
(stop (lambda ()
|
||||
(report-progress size)
|
||||
(display (format #f "@ download-succeeded ~a ~a ~a~%"
|
||||
file url
|
||||
(or (and=> (stat file #f) stat:size)
|
||||
size))
|
||||
log-port)))))
|
||||
(let ((size (or (and=> (stat file #f) stat:size)
|
||||
size)))
|
||||
(report-progress size)
|
||||
(display (format #f "@ download-succeeded ~a ~a ~a~%"
|
||||
file url size)
|
||||
log-port))))))
|
||||
|
||||
;; TODO: replace '(@ (guix build utils) dump-port))'.
|
||||
(define* (dump-port* in out
|
||||
|
|
Loading…
Reference in a new issue