summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-10 00:05:56 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-10 00:05:56 +0000
commitdab7d3062c14f5829719f8b4b2a8384467e49363 (patch)
tree5bca364422e053ab212b69eb28eaa40b21c8744d /urpm
parent9193878389618e3f06e19ee22a96b2d05e5c9745 (diff)
downloadurpmi-dab7d3062c14f5829719f8b4b2a8384467e49363.tar
urpmi-dab7d3062c14f5829719f8b4b2a8384467e49363.tar.gz
urpmi-dab7d3062c14f5829719f8b4b2a8384467e49363.tar.bz2
urpmi-dab7d3062c14f5829719f8b4b2a8384467e49363.tar.xz
urpmi-dab7d3062c14f5829719f8b4b2a8384467e49363.zip
parallel distribution via ssh wasn't working on localhost when network media
were involved
Diffstat (limited to 'urpm')
-rw-r--r--urpm/parallel_ssh.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index c9dd283f..0afba671 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -13,7 +13,12 @@ sub parallel_register_rpms {
foreach (keys %{$parallel->{nodes}}) {
$urpm->{log}("parallel_ssh: scp @files $_:$urpm->{cachedir}/rpms");
- system 'scp' => @files, _host($_) . "$urpm->{cachedir}/rpms";
+ if (_localhost($_)) {
+ my @f = grep { ! m!^$urpm->{cachedir}/rpms! } @files;
+ @f and system 'cp' => @f, "$urpm->{cachedir}/rpms";
+ } else {
+ system 'scp' => @files, "$_:$urpm->{cachedir}/rpms";
+ }
$? == 0 or $urpm->{fatal}(1, urpm::N("scp failed on host %s (%d)", $_, $? >> 8));
}
@@ -210,7 +215,12 @@ sub parallel_install {
foreach (keys %{$parallel->{nodes}}) {
my @sources = (values %$install, values %$upgrade);
$urpm->{ui_msg}("parallel_ssh: scp @sources $_:$urpm->{cachedir}/rpms", urpm::N("Distributing files to %s...", $_));
- system "scp" => @sources, _host($_) . "$urpm->{cachedir}/rpms";
+ if (_localhost($_)) {
+ my @f = grep { ! m!^$urpm->{cachedir}/rpms! } @sources;
+ @f and system 'cp' => @f, "$urpm->{cachedir}/rpms";
+ } else {
+ system 'scp' => @sources, "$_:$urpm->{cachedir}/rpms";
+ }
$? == 0 or $urpm->{fatal}(1, urpm::N("scp failed on host %s (%d)", $_, $? >> 8));
}