summaryrefslogtreecommitdiffstats
path: root/urpm/parallel_ka_run.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-08-27 11:53:11 +0000
committerFrancois Pons <fpons@mandriva.com>2002-08-27 11:53:11 +0000
commitf81bbee311b3be991a13a2aaa3bef8183294e8b2 (patch)
tree526b508e5b91bc2153147f1273935719a7b2cdec /urpm/parallel_ka_run.pm
parent6987d4315ab303a662f93c982795ac1d47c76ba6 (diff)
downloadurpmi-f81bbee311b3be991a13a2aaa3bef8183294e8b2.tar
urpmi-f81bbee311b3be991a13a2aaa3bef8183294e8b2.tar.gz
urpmi-f81bbee311b3be991a13a2aaa3bef8183294e8b2.tar.bz2
urpmi-f81bbee311b3be991a13a2aaa3bef8183294e8b2.tar.xz
urpmi-f81bbee311b3be991a13a2aaa3bef8183294e8b2.zip
4.0-5mdk
Diffstat (limited to 'urpm/parallel_ka_run.pm')
-rw-r--r--urpm/parallel_ka_run.pm24
1 files changed, 13 insertions, 11 deletions
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index ef806b6b..8a60ed8f 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -75,26 +75,27 @@ sub parallel_install {
}
local (*F, $_);
- my ($node, %good_nodes, $bad);
+ my ($node, %bad_nodes);
$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;
+ $bad_nodes{$node} .= $_;
+ /Installation failed/ and $bad_nodes{$node} = '';
+ /Installation is possible/ and delete $bad_nodes{$node}, last;
}
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}";
+ exists $bad_nodes{$_} or next;
+ $urpm->{error}(_("Installation failed on node %s", $_) . ":\n" . $bad_nodes{$_});
}
+ %bad_nodes and return;
+
+ #- 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}" == 0;
}
@@ -102,7 +103,7 @@ sub parallel_install {
package urpm;
sub handle_parallel_options {
my ($urpm, $options) = @_;
- my ($ka_run_options) = $options =~ /ka-run:(.*)/;
+ my ($media, $ka_run_options) = $options =~ /ka-run(?:\(([^\)]*)\))?:(.*)/;
if ($ka_run_options) {
my ($flush_nodes, %nodes);
@@ -117,6 +118,7 @@ sub handle_parallel_options {
}
return bless {
+ media => $media,
options => $ka_run_options,
nodes => \%nodes,
}, "urpm::parallel_ka_run";