summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-10 12:00:19 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-10 12:00:19 +0000
commitd2d2dca3a708deef844317528bbb1152e1bbbc21 (patch)
tree0954e4e09ad18d55c4d4ffd0a0067d3c202aea3b
parentd0e9b1aa125a83f9de08d4554895eaed85386970 (diff)
downloadurpmi-d2d2dca3a708deef844317528bbb1152e1bbbc21.tar
urpmi-d2d2dca3a708deef844317528bbb1152e1bbbc21.tar.gz
urpmi-d2d2dca3a708deef844317528bbb1152e1bbbc21.tar.bz2
urpmi-d2d2dca3a708deef844317528bbb1152e1bbbc21.tar.xz
urpmi-d2d2dca3a708deef844317528bbb1152e1bbbc21.zip
move some code into new function propagate_file()
-rw-r--r--urpm/parallel_ssh.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index 1c416f2b..68c37dfb 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -44,6 +44,13 @@ sub copy_to_dir {
}
}
+sub propagate_file {
+ my ($parallel, $urpm, $file) = @_;
+ foreach (grep { !_localhost($_) } keys %{$parallel->{nodes}}) {
+ _scp($urpm, $_, '-q', $file, $file);
+ }
+}
+
sub _ssh_urpm {
my ($urpm, $node, $cmd, $para) = @_;
@@ -79,9 +86,8 @@ sub parallel_resolve_dependencies {
my ($parallel, $synthesis, $urpm, $state, $requested, %options) = @_;
#- first propagate the synthesis file to all machines
- foreach (grep { !_localhost($_) } keys %{$parallel->{nodes}}) {
- _scp($urpm, $_, '-q', $synthesis, $synthesis);
- }
+ propagate_file($parallel, $urpm, $synthesis);
+
$parallel->{synthesis} = $synthesis;
my $line = urpm::parallel::simple_resolve_dependencies($parallel, $urpm, $state, $requested, %options);