ssh: Factor out progress % calculation.

* guix/ssh.scm (notify-transfer-progress): Trust its % argument.
This commit is contained in:
Tobias Geerinckx-Rice 2023-02-19 01:00:00 +01:00
parent af80906345
commit 9aa750776a
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -477,7 +477,7 @@ (define (notify-transfer-progress item port sizes total sent)
(define (display-bar %)
(erase-current-line port)
(format port "~3@a% ~a"
(inexact->exact (round (* 100. (/ sent total))))
(inexact->exact (round %))
(progress-bar % (- (max (current-terminal-columns) 5) 5)))
(force-output port))