PATCH: better progress reporting

Cameron Simpson cs at zip.com.au
Thu Mar 14 20:32:16 EST 2002


I've been looking at the --progress reporting, which is somewhat
improved these days.  But look at this output of this evening rawhide
mirror update:

	[...]
	perl-DB_File-1.75-27.i386.rpm
	       73430 100%  519.63kB/s    0:00:00
	perl-DB_File-1.75-28.99.3.i386.rpm
	       61783 100%  533.94kB/s    0:00:00
	[...]

Now, while it's good to have the ETA ticking down as something is fetched,
it's irritating to have this history there on the screen afterwards with
those unhelpful zeroes.

Thus the appended patch to util.c in the current CVS head, which for the
final progress report, puts to elapsed time for that file in the report
instead of the time remaining.

Applied (clean) to 2.5.4, it says this:

	++ /home/cameron/tmp/rsy/rsync-2.5.4/rsync -rlHt -z -v -P --delete --include-from=.mirror-rsync '--exclude=xemacs*' '--exclude=kernel-source*' '--exclude=postgresql*' mirror.aarnet.edu.au::redhat/rawhide/i386/RedHat/RPMS/. ./redhat/rawhide/i386/RedHat/RPMS/.

	receiving file list ... 
	2429 files to consider
	2305 files to consider
	./
	timeconfig-3.2.5-1.i386.rpm
	      158253 100%  160.48kB/s    0:00:00
	timidity++-2.10.4-2.i386.rpm
	     9309389 100%  397.71kB/s    0:00:22
	tix-8.2.0b1-67.i386.rpm
	      456809 100%  437.78kB/s    0:00:01
	tk-8.3.3-67.i386.rpm
	     1371196 100%  433.77kB/s    0:00:03

Martin, can this go in for 2.5.5 please?
Any nay sayers?

Cameron Simpson, DoD#743        cs at zip.com.au    http://www.zip.com.au/~cs/

Index: util.c
===================================================================
RCS file: /cvsroot/rsync/util.c,v
retrieving revision 1.107
diff -u -w -r1.107 util.c
--- util.c      23 Feb 2002 00:05:06 -0000      1.107
+++ util.c      14 Mar 2002 09:27:16 -0000
@@ -866,7 +866,9 @@
     unsigned long diff = msdiff(&start_time, now);
     double        rate = diff ? (double) (ofs-start_ofs) * 1000.0 / diff / 1024.0 : 0;
     const char    *units;
-    double        remain = rate ? (double) (size-ofs) / rate / 1000.0: 0.0;
+    double        remain = is_last
+                        ? (double) diff / 1000.0
+                        : rate ? (double) (size-ofs) / rate / 1000.0 : 0.0;
     int          remain_h, remain_m, remain_s;
 
     if (rate > 1024*1024) {





More information about the rsync mailing list