From 2884d491b2e47f393085cebcdc8bcab92937f8b2 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 26 Aug 2002 21:24:02 +0000 Subject: 4.0-4mdk --- urpm/parallel_ssh.pm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'urpm/parallel_ssh.pm') diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm index 5d0c3ea3..46a21b34 100644 --- a/urpm/parallel_ssh.pm +++ b/urpm/parallel_ssh.pm @@ -77,9 +77,28 @@ sub parallel_install { system "scp $sources $_:$urpm->{cachedir}/rpms"; } + my (%good_nodes, $bad); + 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; + } + close F; + } foreach (keys %{$parallel->{nodes}}) { - $urpm->{log}("parallel_ssh: ssh $_ urpmi --auto --synthesis $parallel->{synthesis} $parallel->{line}"); - system "ssh $_ urpmi --auto --synthesis $parallel->{synthesis} $parallel->{line}"; + exists $good_nodes{$_} and next; + $urpm->{error}(_("Installation failed on node %s", $_) . ":\n" . ""); #TODO + $bad = 1; + } + 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}"; + } } } -- cgit v1.2.1