summaryrefslogtreecommitdiffstats
path: root/urpm/parallel_ssh.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-09 22:10:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-09 22:10:00 +0000
commit3c308168d4366576ce817d71ffad67bc0b0b3db4 (patch)
tree94d930abeb59ec4a81c2eda0c9c689e4621af2db /urpm/parallel_ssh.pm
parentfa946e0272248bf7b416a37e6ab4a28cf31fa782 (diff)
downloadurpmi-3c308168d4366576ce817d71ffad67bc0b0b3db4.tar
urpmi-3c308168d4366576ce817d71ffad67bc0b0b3db4.tar.gz
urpmi-3c308168d4366576ce817d71ffad67bc0b0b3db4.tar.bz2
urpmi-3c308168d4366576ce817d71ffad67bc0b0b3db4.tar.xz
urpmi-3c308168d4366576ce817d71ffad67bc0b0b3db4.zip
- handle --nolock on localhost in _ssh_urpm()
- merge diff with parallel_ka_run
Diffstat (limited to 'urpm/parallel_ssh.pm')
-rw-r--r--urpm/parallel_ssh.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index cb379acc..e24b088d 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -15,7 +15,6 @@ our @ISA = (); #- help perl_checker
(our $VERSION) = q($Revision$) =~ /(\d+)/;
sub _localhost { $_[0] eq 'localhost' }
-sub _nolock { &_localhost ? '--nolock ' : '' }
sub _ssh { &_localhost ? '' : "ssh $_[0] " }
sub _host { &_localhost ? '' : "$_[0]:" }
@@ -46,6 +45,9 @@ sub _scp_rpms {
sub _ssh_urpm {
my ($urpm, $node, $cmd, $para) = @_;
+
+ $cmd ne 'urpme' && _localhost($node) and $para = "--nolock $para";
+
my $command = _ssh($node) . " $cmd --no-locales $para";
$urpm->{log}("parallel_ssh: $command");
$command;
@@ -128,7 +130,7 @@ sub parallel_resolve_dependencies {
delete $state->{selected};
#- now try an iteration of urpmq.
foreach my $node (keys %{$parallel->{nodes}}) {
- my $fh = _ssh_urpm_popen($urpm, $node, "urpmq", _nolock($node) . "--synthesis $synthesis -fduc $line " . join(' ', keys %chosen));
+ my $fh = _ssh_urpm_popen($urpm, $node, "urpmq", "--synthesis $synthesis -fduc $line " . join(' ', keys %chosen));
while (my $s = <$fh>) {
urpm::parallel::parse_urpmq_output($urpm, $state, $node, $s, \$cont, \%chosen, %options);
@@ -151,7 +153,7 @@ sub parallel_install {
my %bad_nodes;
foreach my $node (keys %{$parallel->{nodes}}) {
- my $fh = _ssh_urpm_popen($urpm, $node, 'urpmi', "--pre-clean --test --no-verify-rpm --auto " . _nolock($node) . "--synthesis $parallel->{synthesis} $parallel->{line}");
+ my $fh = _ssh_urpm_popen($urpm, $node, 'urpmi', "--pre-clean --test --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}");
while (my $s = <$fh>) {
$bad_nodes{$node} .= $s;
@@ -170,10 +172,10 @@ sub parallel_install {
$urpm->{error}(N("Installation is possible"));
1;
} else {
- my $line = $parallel->{line} . ($options{excludepath} ? " --excludepath $options{excludepath}" : "");
+ 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 " . _nolock($node) . "--synthesis $parallel->{synthesis} $line");
+ my $command = _ssh_urpm($urpm, $node, 'urpmi', "--no-verify-rpm --auto --synthesis $parallel->{synthesis} $line");
system($command);
}
}