summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-06-28 08:42:08 +0000
committerFrancois Pons <fpons@mandriva.com>2002-06-28 08:42:08 +0000
commit4b8a4f606f29c517d129d8a3efd5ec53bbe4201c (patch)
treef2a0538117d72300a852adba7d3c36f6b3a5c4f1 /urpm.pm
parent70b30041f278c33ec79a8c9d96c65768a42844ba (diff)
downloadurpmi-4b8a4f606f29c517d129d8a3efd5ec53bbe4201c.tar
urpmi-4b8a4f606f29c517d129d8a3efd5ec53bbe4201c.tar.gz
urpmi-4b8a4f606f29c517d129d8a3efd5ec53bbe4201c.tar.bz2
urpmi-4b8a4f606f29c517d129d8a3efd5ec53bbe4201c.tar.xz
urpmi-4b8a4f606f29c517d129d8a3efd5ec53bbe4201c.zip
3.6-3mdk
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/urpm.pm b/urpm.pm
index 9e1382de..de096572 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -230,8 +230,14 @@ sub sync_rsync {
-x "/usr/bin/rsync" or die _("rsync is missing\n");
-x "/usr/bin/ssh" or die _("ssh is missing\n");
my $options = shift @_;
- system "/usr/bin/rsync", (ref $options && $options->{quiet} ? ("-q") : ("--progress", "-v")), "--partial", "-e", "ssh",
- @_, (ref $options ? $options->{dir} : $options);
+ foreach (@_) {
+ my $count = 3; #- retry count on error (if file exists).
+ my $basename = (/^.*\/([^\/]*)$/ && $1) || $_;
+ do {
+ system "/usr/bin/rsync", (ref $options && $options->{quiet} ? ("-q") : ("--progress", "-v")), "--partial", "-e", "ssh",
+ $_, (ref $options ? $options->{dir} : $options);
+ } while ($? != 0 && --$count > 0 && (-e (ref $options ? $options->{dir} : $options) . "/$basename"));
+ }
$? == 0 or die _("rsync failed: exited with %d or signal %d\n", $? >> 8, $? & 127);
}