diff options
author | Francois Pons <fpons@mandriva.com> | 2002-08-26 21:24:02 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-08-26 21:24:02 +0000 |
commit | 2884d491b2e47f393085cebcdc8bcab92937f8b2 (patch) | |
tree | 976ff2e3a73ff04d7f20b14eae76112939d9f241 /urpm | |
parent | 28df52a7dce6e7aee0fa1ebd2c921b8deb813170 (diff) | |
download | urpmi-2884d491b2e47f393085cebcdc8bcab92937f8b2.tar urpmi-2884d491b2e47f393085cebcdc8bcab92937f8b2.tar.gz urpmi-2884d491b2e47f393085cebcdc8bcab92937f8b2.tar.bz2 urpmi-2884d491b2e47f393085cebcdc8bcab92937f8b2.tar.xz urpmi-2884d491b2e47f393085cebcdc8bcab92937f8b2.zip |
4.0-4mdk
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/parallel_ka_run.pm | 25 | ||||
-rw-r--r-- | urpm/parallel_ssh.pm | 23 |
2 files changed, 43 insertions, 5 deletions
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 ($_ = <F>) { + 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 ($_ = <F>) { + 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}"; + } } } |