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_ka_run.pm | 25 ++++++++++++++++++++++--- urpm/parallel_ssh.pm | 23 +++++++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) (limited to 'urpm') diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm index dacc1056..ef806b6b 100644 --- a/urpm/parallel_ka_run.pm +++ b/urpm/parallel_ka_run.pm @@ -52,7 +52,7 @@ sub parallel_resolve_dependencies { $state->{selected}{$pkg->id}{$node} = $_; } } - close F or $urpm->{fatal}(1, _("host %s does not have a good version of urpmi", $node)); + close F or $urpm->{fatal}(1, _("rshp failed")); #- check for internal error of resolution. $cont == 1 and die "internal distant urpmq error on choice not taken"; } while ($cont); @@ -74,8 +74,27 @@ sub parallel_install { system "mput $parallel->{options} -- '$_' $urpm->{cachedir}/rpms/$basename"; } - $urpm->{log}("parallel_ka_run: rshp -v $parallel->{options} -- urpmi --synthesis $parallel->{synthesis} $parallel->{line}"); - system "rshp -v $parallel->{options} -- urpmi --auto --synthesis $parallel->{synthesis} $parallel->{line}"; + local (*F, $_); + my ($node, %good_nodes, $bad); + $urpm->{log}("parallel_ka_run: rshp -v $parallel->{options} -- urpmi --no-locales --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"); + open F, "rshp -v $parallel->{options} -- urpmi --no-locales --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line} |"; + while ($_ = ) { + chomp; + s/<([^>]*)>.*:->:(.*)/$2/ and $node = $1; + /Installation is possible/ and $good_nodes{$node} = undef; + } + close F or $urpm->{fatal}(1, _("rshp failed")); + + foreach (keys %{$parallel->{nodes}}) { + exists $good_nodes{$_} and next; + $urpm->{error}(_("Installation failed on node %s", $_) . ":\n" . ""); #TODO + $bad = 1; + } + unless ($bad) { + #- continue installation. + $urpm->{log}("parallel_ka_run: rshp $parallel->{options} -- urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"); + system "rshp $parallel->{options} -- urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}"; + } } 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