summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-10 12:16:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-10 12:16:52 +0000
commit33b98d0d9ef1964a85ae3aa0ecd74b874f980281 (patch)
tree72e91bdec6ba68e9de4ce7119ac5d3721bdaf2c8 /urpm
parentf3d768e69f427e8216908f4cc0ac8a96574d1e68 (diff)
downloadurpmi-33b98d0d9ef1964a85ae3aa0ecd74b874f980281.tar
urpmi-33b98d0d9ef1964a85ae3aa0ecd74b874f980281.tar.gz
urpmi-33b98d0d9ef1964a85ae3aa0ecd74b874f980281.tar.bz2
urpmi-33b98d0d9ef1964a85ae3aa0ecd74b874f980281.tar.xz
urpmi-33b98d0d9ef1964a85ae3aa0ecd74b874f980281.zip
move code into run_urpm_command()
Diffstat (limited to 'urpm')
-rw-r--r--urpm/parallel_ka_run.pm7
-rw-r--r--urpm/parallel_ssh.pm13
2 files changed, 15 insertions, 5 deletions
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index 4352cd00..420921f2 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -54,6 +54,11 @@ sub urpm_popen {
close $fh or $urpm->{fatal}(1, N("rshp failed, maybe a node is unreacheable"));
}
+sub run_urpm_command {
+ my ($parallel, $urpm, $cmd, $para) = @_;
+ system(_rshp_urpm($parallel, $urpm, '', $cmd, $para)) == 0;
+}
+
sub copy_to_dir { &_run_mput }
sub propagate_file {
@@ -99,7 +104,7 @@ sub parallel_install {
} else {
my $line = $parallel->{line} . ($options{excludepath} ? " --excludepath '$options{excludepath}'" : "");
#- continue installation.
- system(_rshp_urpm($parallel, $urpm, '', 'urpmi', "--no-verify-rpm --auto --synthesis $parallel->{synthesis} $line")) == 0;
+ run_urpm_command($parallel, $urpm, 'urpmi', "--no-verify-rpm --auto --synthesis $parallel->{synthesis} $line");
}
}
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index 23819374..e70ff41e 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -81,6 +81,14 @@ sub urpm_popen {
}
}
+sub run_urpm_command {
+ my ($parallel, $urpm, $cmd, $para) = @_;
+
+ foreach my $node (keys %{$parallel->{nodes}}) {
+ system(_ssh_urpm($urpm, $node, $cmd, $para));
+ }
+}
+
#- parallel install.
sub parallel_install {
my ($parallel, $urpm, undef, $install, $upgrade, %options) = @_;
@@ -110,10 +118,7 @@ sub parallel_install {
} else {
my $line = $parallel->{line} . ($options{excludepath} ? " --excludepath '$options{excludepath}'" : "");
#- continue installation on each node
- foreach my $node (keys %{$parallel->{nodes}}) {
- my $command = _ssh_urpm($urpm, $node, 'urpmi', "--no-verify-rpm --auto --synthesis $parallel->{synthesis} $line");
- system($command);
- }
+ run_urpm_command($parallel, $urpm, 'urpmi', "--no-verify-rpm --auto --synthesis $parallel->{synthesis} $line");
}
}