fix for progress bar (don't fake slowdown)
[webpac] / all2xml.pl
index ca4b4e0..02b2d2c 100755 (executable)
@@ -687,7 +687,9 @@ print STDERR "reading ./import_xml/$type.xml\n";
                my $current = shift;
                my $total = shift || 1;
                my $p = int($current * 100 / $total);
-               if ($p != $last_p) {
+               if ($p < $last_p) {
+                       $start_t = time();
+               } elsif ($p != $last_p) {
                        my $rate = ($current / (time() - $start_t || 1));
                        my $eta = ($total-$current) / ($rate || 1);
                        printf STDERR ("%5d [%-38s] %-5d %0.1f/s %s\r",$current,"=" x ($p/3)."$p%>", $total, $rate, fmt_time($eta));