From d2d2dca3a708deef844317528bbb1152e1bbbc21 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 10 Jul 2008 12:00:19 +0000 Subject: move some code into new function propagate_file() --- urpm/parallel_ssh.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'urpm') 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); -- cgit v1.2.1