summaryrefslogtreecommitdiffstats
path: root/urpm/parallel_ka_run.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-09 20:34:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-09 20:34:13 +0000
commit022b192bb12edab968398019f1fae97245819084 (patch)
tree75c1d6512186b43be979b105b7f37669af42ff47 /urpm/parallel_ka_run.pm
parent2011d301c5135cdd39b857df3ba9867a434111f5 (diff)
downloadurpmi-022b192bb12edab968398019f1fae97245819084.tar
urpmi-022b192bb12edab968398019f1fae97245819084.tar.gz
urpmi-022b192bb12edab968398019f1fae97245819084.tar.bz2
urpmi-022b192bb12edab968398019f1fae97245819084.tar.xz
urpmi-022b192bb12edab968398019f1fae97245819084.zip
create run_mput() and use it
Diffstat (limited to 'urpm/parallel_ka_run.pm')
-rw-r--r--urpm/parallel_ka_run.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index 338c86a4..bc886386 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -33,12 +33,19 @@ sub rshp_command {
$cmd;
}
+sub run_mput {
+ my ($urpm, $parallel, @para) = @_;
+
+ my @l = (split(' ', $parallel->{options}), '--', @para);
+ $urpm->{log}("parallel_ka_run: $mput_command " . join(' ', @l));
+ system $mput_command, @l;
+}
+
#- parallel copy
sub parallel_register_rpms {
my ($parallel, $urpm, @files) = @_;
- $urpm->{log}("parallel_ka_run: $mput_command $parallel->{options} -- @files $urpm->{cachedir}/rpms/");
- system $mput_command, split(' ', $parallel->{options}), '--', @files, "$urpm->{cachedir}/rpms/";
+ run_mput($urpm, $parallel, @files, "$urpm->{cachedir}/rpms/");
$? == 0 || $? == 256 or $urpm->{fatal}(1, N("mput failed, maybe a node is unreacheable"));
urpm::parallel::post_register_rpms($parallel, $urpm, @files);
@@ -93,8 +100,7 @@ sub parallel_resolve_dependencies {
my (%avoided, %requested);
#- first propagate the synthesis file to all machines
- $urpm->{log}("parallel_ka_run: $mput_command $parallel->{options} -- '$synthesis' '$synthesis'");
- system($mput_command, $parallel->{options}, '--', $synthesis, $synthesis);
+ run_mput($urpm, $parallel, $synthesis, $synthesis);
$? == 0 || $? == 256 or $urpm->{fatal}(1, N("mput failed, maybe a node is unreacheable"));
$parallel->{synthesis} = $synthesis;
@@ -186,8 +192,7 @@ sub parallel_resolve_dependencies {
sub parallel_install {
my ($parallel, $urpm, undef, $install, $upgrade, %options) = @_;
- $urpm->{log}("parallel_ka_run: $mput_command $parallel->{options} -- " . join(' ', values %$install, values %$upgrade) . " $urpm->{cachedir}/rpms/");
- system $mput_command, split(' ', $parallel->{options}), '--', values %$install, values %$upgrade, "$urpm->{cachedir}/rpms/";
+ run_mput($urpm, $parallel, values %$install, values %$upgrade, "$urpm->{cachedir}/rpms/");
$? == 0 || $? == 256 or $urpm->{fatal}(1, N("mput failed, maybe a node is unreacheable"));
local $_;