From 3c308168d4366576ce817d71ffad67bc0b0b3db4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 9 Jul 2008 22:10:00 +0000 Subject: - handle --nolock on localhost in _ssh_urpm() - merge diff with parallel_ka_run --- urpm/parallel_ssh.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'urpm') 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); } } -- cgit v1.2.1