From nobody@FreeBSD.org  Sat Oct  6 21:15:33 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id A641937B401
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Oct 2001 21:15:33 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f974FXq59933;
	Sat, 6 Oct 2001 21:15:33 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200110070415.f974FXq59933@freefall.freebsd.org>
Date: Sat, 6 Oct 2001 21:15:33 -0700 (PDT)
From: Greg Moncreaff <moncrg@ma.ultranet.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: show more precision in fetch % complete
X-Send-Pr-Version: www-1.0

>Number:         31094
>Category:       bin
>Synopsis:       show more precision in fetch % complete
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 06 21:20:01 PDT 2001
>Closed-Date:    Tue Oct 16 05:31:30 PDT 2001
>Last-Modified:  Tue Oct 16 05:32:24 PDT 2001
>Originator:     Greg Moncreaff
>Release:        4.4
>Organization:
>Environment:
>Description:
with large downloads on slow connection the fetch % complete
doesn't update meaninfully
>How-To-Repeat:

>Fix:
cvs diff -u fetch.c
Index: fetch.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/fetch/fetch.c,v
retrieving revision 1.10.2.15
diff -u -r1.10.2.15 fetch.c
--- fetch.c     2001/08/16 02:04:00     1.10.2.15
+++ fetch.c     2001/09/23 18:13:34
@@ -129,8 +129,8 @@
     if (xs->size <= 0)
        fprintf(stderr, ": %lld bytes", xs->rcvd);
     else
-       fprintf(stderr, " (%lld bytes): %d%%", xs->size,
-               (int)((100.0 * xs->rcvd) / xs->size));
+       fprintf(stderr, " (%lld bytes): %3.1f%%", xs->size,
+               (float)((100.0 * xs->rcvd) / xs->size));
 }
 
 void

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Sun Oct 7 11:40:02 PDT 2001 
Responsible-Changed-Why:  
fetch(1) is mine. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31094 

From: Dag-Erling Smorgrav <des@ofug.org>
To: Greg Moncreaff <moncrg@ma.ultranet.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/31094: show more precision in fetch % complete
Date: 07 Oct 2001 20:43:20 +0200

 Greg Moncreaff <moncrg@ma.ultranet.com> writes:
 > @@ -129,8 +129,8 @@
 >      if (xs->size <= 0)
 >         fprintf(stderr, ": %lld bytes", xs->rcvd);
 >      else
 > -       fprintf(stderr, " (%lld bytes): %d%%", xs->size,
 > -               (int)((100.0 * xs->rcvd) / xs->size));
 > +       fprintf(stderr, " (%lld bytes): %3.1f%%", xs->size,
 > +               (float)((100.0 * xs->rcvd) / xs->size));
 >  }
 
 The cast to float is not only unnecessary but meaningless, since
 fprintf() is a vararg function, which means that the float is promoted
 back to double anyway.  The width specifier in the format string is
 also unnecessary.
 
 DES
 -- 
 Dag-Erling Smorgrav - des@ofug.org
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Tue Oct 16 05:31:30 PDT 2001 
State-Changed-Why:  
I'd rather keep it the way it is.  Fetch already has a SIGINFO handler for 
the impatient. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31094 
>Unformatted:
