summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-08-26 14:07:23 +0000
committerFrancois Pons <fpons@mandriva.com>2003-08-26 14:07:23 +0000
commit60fe56c55c0dc72c723723e2fc10e9480a1ffd09 (patch)
tree9a6bfbd60c621725a8b0eb06e07d6b1c8426ed87
parent717ff0a00896c553f04eac6b7497fa3884f7633d (diff)
downloadurpmi-60fe56c55c0dc72c723723e2fc10e9480a1ffd09.tar
urpmi-60fe56c55c0dc72c723723e2fc10e9480a1ffd09.tar.gz
urpmi-60fe56c55c0dc72c723723e2fc10e9480a1ffd09.tar.bz2
urpmi-60fe56c55c0dc72c723723e2fc10e9480a1ffd09.tar.xz
urpmi-60fe56c55c0dc72c723723e2fc10e9480a1ffd09.zip
added -z option for rsync:// protocol
fixed download progressive glitches loging.
-rw-r--r--urpm.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/urpm.pm b/urpm.pm
index 4f7c1857..662f6343 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -320,7 +320,7 @@ sub sync_rsync {
open RSYNC, join(" ", map { "'$_'" } "/usr/bin/rsync",
($limit_rate ? "--bwlimit=$limit_rate" : ()),
(ref($options) && $options->{quiet} ? qw(-q) : qw(--progress -v)),
- qw(--partial --no-whole-file), $file, (ref($options) ? $options->{dir} : $options)) . " |";
+ qw(--partial -z --no-whole-file), $file, (ref($options) ? $options->{dir} : $options)) . " |";
local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!).
while (<RSYNC>) {
$buf .= $_;
@@ -389,11 +389,13 @@ sub sync_logger {
if ($mode eq 'start') {
print STDERR " $file\n";
} elsif ($mode eq 'progress') {
+ my $text;
if (defined $total && defined $eta) {
- print STDERR N(" %s%% of %s completed, ETA = %s, speed = %s", $percent, $total, $eta, $speed) . "\r";
+ $text = N(" %s%% of %s completed, ETA = %s, speed = %s", $percent, $total, $eta, $speed);
} else {
- print STDERR N(" %s%% completed, speed = %s", $percent, $speed) . "\r";
+ $text = N(" %s%% completed, speed = %s", $percent, $speed);
}
+ print STDERR " " x (79 - length($text)) . "\r";
} elsif ($mode eq 'end') {
print STDERR " " x 79, "\r";
}