Patch from Jeremy Bornstein to transfer files only by mtime, not
[rsync/rsync-patches.git] / cs-progress.diff
CommitLineData
57302e90
MP
1From rsync-admin@lists.samba.org Thu Mar 14 01:33:43 2002
2Return-Path: <rsync-admin@lists.samba.org>
3Delivered-To: mbp@samba.org
4Received: from va.samba.org (localhost [127.0.0.1])
5 by lists.samba.org (Postfix) with ESMTP
6 id 25DCA4481; Thu, 14 Mar 2002 01:33:41 -0800 (PST)
7Delivered-To: rsync@samba.org
8Received: from cskk.homeip.net (c17877.carlnfd1.nsw.optusnet.com.au [210.49.140.231])
9 by lists.samba.org (Postfix) with ESMTP
10 id 49D8544F8; Thu, 14 Mar 2002 01:31:54 -0800 (PST)
11Received: (from cameron@localhost)
12 by cskk.homeip.net (8.11.6/8.11.6) id g2E9WGM22435;
13 Thu, 14 Mar 2002 20:32:16 +1100
14From: Cameron Simpson <cs@zip.com.au>
15To: rsync@samba.org
16Cc: mbp@samba.org
17Subject: PATCH: better progress reporting
18Message-ID: <20020314093215.GA18634@amadeus.home>
19Reply-To: cs@zip.com.au
20Mime-Version: 1.0
21Content-Type: text/plain; charset=us-ascii
22Content-Disposition: inline
23User-Agent: Mutt/1.3.27i
24Sender: rsync-admin@lists.samba.org
25Errors-To: rsync-admin@lists.samba.org
26X-BeenThere: rsync@lists.samba.org
27X-Mailman-Version: 2.0.8
28Precedence: bulk
29List-Help: <mailto:rsync-request@lists.samba.org?subject=help>
30List-Post: <mailto:rsync@lists.samba.org>
31List-Subscribe: <http://lists.samba.org/mailman/listinfo/rsync>,
32 <mailto:rsync-request@lists.samba.org?subject=subscribe>
33List-Id: rsync user list <rsync.lists.samba.org>
34List-Unsubscribe: <http://lists.samba.org/mailman/listinfo/rsync>,
35 <mailto:rsync-request@lists.samba.org?subject=unsubscribe>
36List-Archive: <http://lists.samba.org/pipermail/rsync/>
37Date: Thu, 14 Mar 2002 20:32:16 +1100
38Status: RO
39Content-Length: 2389
40Lines: 64
41
42I've been looking at the --progress reporting, which is somewhat
43improved these days. But look at this output of this evening rawhide
44mirror update:
45
46 [...]
47 perl-DB_File-1.75-27.i386.rpm
48 73430 100% 519.63kB/s 0:00:00
49 perl-DB_File-1.75-28.99.3.i386.rpm
50 61783 100% 533.94kB/s 0:00:00
51 [...]
52
53Now, while it's good to have the ETA ticking down as something is fetched,
54it's irritating to have this history there on the screen afterwards with
55those unhelpful zeroes.
56
57Thus the appended patch to util.c in the current CVS head, which for the
58final progress report, puts to elapsed time for that file in the report
59instead of the time remaining.
60
61Applied (clean) to 2.5.4, it says this:
62
63 ++ /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/.
64
65 receiving file list ...
66 2429 files to consider
67 2305 files to consider
68 ./
69 timeconfig-3.2.5-1.i386.rpm
70 158253 100% 160.48kB/s 0:00:00
71 timidity++-2.10.4-2.i386.rpm
72 9309389 100% 397.71kB/s 0:00:22
73 tix-8.2.0b1-67.i386.rpm
74 456809 100% 437.78kB/s 0:00:01
75 tk-8.3.3-67.i386.rpm
76 1371196 100% 433.77kB/s 0:00:03
77
78Martin, can this go in for 2.5.5 please?
79Any nay sayers?
80
81Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
82
83Index: util.c
84===================================================================
85RCS file: /cvsroot/rsync/util.c,v
86retrieving revision 1.107
87diff -u -w -r1.107 util.c
88--- util.c 23 Feb 2002 00:05:06 -0000 1.107
89+++ util.c 14 Mar 2002 09:27:16 -0000
90@@ -866,7 +866,9 @@
91 unsigned long diff = msdiff(&start_time, now);
92 double rate = diff ? (double) (ofs-start_ofs) * 1000.0 / diff / 1024.0 : 0;
93 const char *units;
94- double remain = rate ? (double) (size-ofs) / rate / 1000.0: 0.0;
95+ double remain = is_last
96+ ? (double) diff / 1000.0
97+ : rate ? (double) (size-ofs) / rate / 1000.0 : 0.0;
98 int remain_h, remain_m, remain_s;
99
100 if (rate > 1024*1024) {
101
102
103--
104To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
105Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
106