From dab7d3062c14f5829719f8b4b2a8384467e49363 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 10 Jun 2005 00:05:56 +0000 Subject: parallel distribution via ssh wasn't working on localhost when network media were involved --- urpm/parallel_ssh.pm | 14 ++++++++++++-- 1 file 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)); } -- cgit v1.2.1