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
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ Use SIZES to determine the size of ITEM, which is about to be 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))