From: "Clément Lassieur" <clement@lassieur.org>
To: 33376@debbugs.gnu.org
Subject: [bug#33376] [PATCH 1/2] progress: Fix crash because of division by zero.
Date: Wed, 14 Nov 2018 11:13:11 +0100 [thread overview]
Message-ID: <20181114101312.23617-1-clement@lassieur.org> (raw)
In-Reply-To: <87o9asezpw.fsf@lassieur.org>
* guix/progress.scm (display-download-progress): Handle the case where SIZE is
null.
---
guix/progress.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix/progress.scm b/guix/progress.scm
index 9da667a02..7a25f11bd 100644
--- a/guix/progress.scm
+++ b/guix/progress.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2017 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2015 Steve Sprang <scs@stevesprang.com>
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -197,7 +198,7 @@ throughput."
(define elapsed
(duration->seconds
(time-difference (current-time time-monotonic) start-time)))
- (if (number? size)
+ (if (and (number? size) (not (zero? size)))
(let* ((% (* 100.0 (/ transferred size)))
(throughput (/ transferred elapsed))
(left (format #f " ~a ~a" file
--
2.19.1
next prev parent reply other threads:[~2018-11-14 10:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 10:10 [bug#33376] fixes related to 'guix publish' being run without the '--cache' option Clément Lassieur
2018-11-14 10:13 ` Clément Lassieur [this message]
2018-11-14 10:13 ` [bug#33376] [PATCH 2/2] progress: Do not display the last 0B transfer when size is unknown Clément Lassieur
2018-11-16 13:43 ` Mathieu Othacehe
2018-11-16 13:55 ` bug#33376: " Clément Lassieur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181114101312.23617-1-clement@lassieur.org \
--to=clement@lassieur.org \
--cc=33376@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.