summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-08 07:21:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-08 07:21:25 +0000
commit20b6178a5f49f60acc7cb28808d1aef3ffe7a80b (patch)
tree329741d1bad565c817334ec69fdf3ca87189bf56
parent0a1f18d5c5ffda545bba502cfc4485d3a22d8c0e (diff)
downloadurpmi-20b6178a5f49f60acc7cb28808d1aef3ffe7a80b.tar
urpmi-20b6178a5f49f60acc7cb28808d1aef3ffe7a80b.tar.gz
urpmi-20b6178a5f49f60acc7cb28808d1aef3ffe7a80b.tar.bz2
urpmi-20b6178a5f49f60acc7cb28808d1aef3ffe7a80b.tar.xz
urpmi-20b6178a5f49f60acc7cb28808d1aef3ffe7a80b.zip
Don't shell out when calling scp
-rw-r--r--urpm/parallel_ssh.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index b656f331..de2c5ef0 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -1,4 +1,5 @@
package urpm::parallel_ssh;
+
use Time::HiRes qw(gettimeofday);
#- parallel copy
@@ -8,7 +9,7 @@ sub parallel_register_rpms {
foreach (keys %{$parallel->{nodes}}) {
my $sources = join ' ', map { "'$_'" } @files;
$urpm->{log}("parallel_ssh: scp $sources $_:$urpm->{cachedir}/rpms");
- system "scp $sources $_:$urpm->{cachedir}/rpms";
+ system 'scp' => $sources, "$_:$urpm->{cachedir}/rpms";
$? == 0 or $urpm->{fatal}(1, urpm::N("scp failed on host %s (%d)", $_, $? >> 8));
}
@@ -25,7 +26,7 @@ sub parallel_find_remove {
my ($test, $node, %bad_nodes, %base_to_remove, %notfound);
local (*F, $_);
- #- keep in mind if the previous selection is still active, it avoid
+ #- keep in mind if the previous selection is still active, it avoids
#- to re-start urpme --test on each node.
if ($options{find_packages_to_remove}) {
delete $state->{rejected};
@@ -104,8 +105,8 @@ sub parallel_resolve_dependencies {
#- first propagate the synthesis file to all machine.
foreach (keys %{$parallel->{nodes}}) {
- $urpm->{ui_msg}("parallel_ssh: scp -q '$synthesis' '$_:$synthesis'", urpm::N("Propagating synthesis to %s...", $_));
- system "scp -q '$synthesis' '$_:$synthesis'";
+ $urpm->{ui_msg}("parallel_ssh: scp -q '$synthesis' '$_:$synthesis'", urpm::N("Propagating synthesis to %s...", $_));
+ system "scp", "-q", $synthesis, "$_:$synthesis";
$? == 0 or $urpm->{fatal}(1, urpm::N("scp failed on host %s (%d)", $_, $? >> 8));
}
$parallel->{synthesis} = $synthesis;
@@ -202,8 +203,8 @@ sub parallel_install {
foreach (keys %{$parallel->{nodes}}) {
my $sources = join ' ', map { "'$_'" } values %$install, values %$upgrade;
- $urpm->{ui_msg}("parallel_ssh: scp $sources $_:$urpm->{cachedir}/rpms", urpm::N("Distributing files to %s...", $_));
- system "scp $sources $_:$urpm->{cachedir}/rpms";
+ $urpm->{ui_msg}("parallel_ssh: scp $sources $_:$urpm->{cachedir}/rpms", urpm::N("Distributing files to %s...", $_));
+ system "scp", $sources, "$_:$urpm->{cachedir}/rpms";
$? == 0 or $urpm->{fatal}(1, urpm::N("scp failed on host %s (%d)", $_, $? >> 8));
}