From f81bbee311b3be991a13a2aaa3bef8183294e8b2 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 27 Aug 2002 11:53:11 +0000 Subject: 4.0-5mdk --- urpm/parallel_ssh.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'urpm/parallel_ssh.pm') diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm index 46a21b34..bd7ee200 100644 --- a/urpm/parallel_ssh.pm +++ b/urpm/parallel_ssh.pm @@ -77,29 +77,30 @@ sub parallel_install { system "scp $sources $_:$urpm->{cachedir}/rpms"; } - my (%good_nodes, $bad); + my %bad_nodes; foreach my $node (keys %{$parallel->{nodes}}) { local (*F, $_); $urpm->{log}("parallel_ssh: ssh $node urpmi --no-locales --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"); open F, "ssh $node urpmi --no-locales --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line} |"; while ($_ = ) { - chomp; - /Installation is possible/ and $good_nodes{$node} = undef; + $bad_nodes{$node} .= $_; + /Installation failed/ and $bad_nodes{$node} = ''; + /Installation is possible/ and delete $bad_nodes{$node}, last; } close F; } foreach (keys %{$parallel->{nodes}}) { - exists $good_nodes{$_} and next; - $urpm->{error}(_("Installation failed on node %s", $_) . ":\n" . ""); #TODO - $bad = 1; + exists $bad_nodes{$_} or next; + $urpm->{error}(_("Installation failed on node %s", $_) . ":\n" . $bad_nodes{$_}); } - unless ($bad) { - foreach my $node (keys %{$parallel->{nodes}}) { - #- continue installation. - $urpm->{log}("parallel_ssh: ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"); - system "ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"; - } + %bad_nodes and return; + + #- continue installation on each nodes. + foreach my $node (keys %{$parallel->{nodes}}) { + $urpm->{log}("parallel_ssh: ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"); + system "ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"; } + 1; } @@ -109,10 +110,11 @@ sub handle_parallel_options { my ($urpm, $options) = @_; my ($id, @nodes) = split ':', $options; - if ($id eq 'ssh') { + if ($id =~ /^ssh(?:\(([^\)]*)\))?$/) { my %nodes; @nodes{@nodes} = undef; return bless { + media => $1, nodes => \%nodes, }, "urpm::parallel_ssh"; } -- cgit v1.2.1