summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-10 12:08:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-10 12:08:57 +0000
commitf3d768e69f427e8216908f4cc0ac8a96574d1e68 (patch)
tree109f7c5c1cb05da258c5c7e1068c48664bc28344 /urpm
parent19fb5fabfa650f4ec9645b8112b81a66ea456d10 (diff)
downloadurpmi-f3d768e69f427e8216908f4cc0ac8a96574d1e68.tar
urpmi-f3d768e69f427e8216908f4cc0ac8a96574d1e68.tar.gz
urpmi-f3d768e69f427e8216908f4cc0ac8a96574d1e68.tar.bz2
urpmi-f3d768e69f427e8216908f4cc0ac8a96574d1e68.tar.xz
urpmi-f3d768e69f427e8216908f4cc0ac8a96574d1e68.zip
have an implementation that works both on ssh and rshp (where outputs are intermingled)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/parallel_ka_run.pm5
-rw-r--r--urpm/parallel_ssh.pm6
2 files changed, 7 insertions, 4 deletions
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index 58ec5798..4352cd00 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -76,15 +76,16 @@ sub parallel_install {
copy_to_dir($parallel, $urpm, values %$install, values %$upgrade, "$urpm->{cachedir}/rpms");
- my %bad_nodes;
+ my (%bad_nodes, @good_nodes);
$parallel->urpm_popen($urpm, 'urpmi', "--pre-clean --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}", sub {
my ($node, $s) = @_;
$s =~ /^\s*$/ and return;
$bad_nodes{$node} .= $s;
$s =~ /Installation failed/ and $bad_nodes{$node} = '';
- $s =~ /Installation is possible/ and delete $bad_nodes{$node};
+ $s =~ /Installation is possible/ and push @good_nodes, $node;
undef;
});
+ delete $bad_nodes{$_} foreach @good_nodes;
foreach (keys %{$parallel->{nodes}}) {
exists $bad_nodes{$_} or next;
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index cfffe0c2..23819374 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -87,15 +87,17 @@ sub parallel_install {
copy_to_dir($parallel, $urpm, values %$install, values %$upgrade, "$urpm->{cachedir}/rpms");
- my %bad_nodes;
+ my (%bad_nodes, @good_nodes);
$parallel->urpm_popen($urpm, 'urpmi', "--pre-clean --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}", sub {
my ($node, $s) = @_;
$s =~ /^\s*$/ and return;
$bad_nodes{$node} .= $s;
$s =~ /Installation failed/ and $bad_nodes{$node} = '';
- $s =~ /Installation is possible/ and delete $bad_nodes{$node}, return 1;
+ $s =~ /Installation is possible/ and push @good_nodes, $node;
undef;
});
+ delete $bad_nodes{$_} foreach @good_nodes;
+
foreach (keys %{$parallel->{nodes}}) {
exists $bad_nodes{$_} or next;
$urpm->{error}(N("Installation failed on node %s", $_) . ":\n" . $bad_nodes{$_});