ssh: Fix progress bar crash when there are zero items to send.
* guix/ssh.scm (notify-transfer-progress): Do nothing when TOTAL is zero.master
parent
de83660dd3
commit
44c6e6f590
17
guix/ssh.scm
17
guix/ssh.scm
|
@ -441,14 +441,15 @@ Use SIZES to determine the size of ITEM, which is about to be sent."
|
||||||
(progress-bar % (- (max (current-terminal-columns) 5) 5)))
|
(progress-bar % (- (max (current-terminal-columns) 5) 5)))
|
||||||
(force-output port))
|
(force-output port))
|
||||||
|
|
||||||
(let ((% (* 100. (/ sent total))))
|
(unless (zero? total)
|
||||||
(match (vhash-assoc item sizes)
|
(let ((% (* 100. (/ sent total))))
|
||||||
(#f
|
(match (vhash-assoc item sizes)
|
||||||
(display-bar %)
|
(#f
|
||||||
(values port sizes total sent))
|
(display-bar %)
|
||||||
((_ . size)
|
(values port sizes total sent))
|
||||||
(display-bar %)
|
((_ . size)
|
||||||
(values port sizes total (+ sent size))))))
|
(display-bar %)
|
||||||
|
(values port sizes total (+ sent size)))))))
|
||||||
|
|
||||||
(define (notify-transfer-completion port . args)
|
(define (notify-transfer-completion port . args)
|
||||||
"Notify the user that the transfer has completed."
|
"Notify the user that the transfer has completed."
|
||||||
|
|
Reference in New Issue