diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-07-10 12:03:41 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-07-10 12:03:41 +0000 |
commit | 0404e11b2a788856dc738e310982dca789f79974 (patch) | |
tree | 9513eb7b114423c8fe0f102f62a5e14481daf59f /urpm | |
parent | 160f9e0f28624898448baae75c5cbd9716b9d790 (diff) | |
download | urpmi-0404e11b2a788856dc738e310982dca789f79974.tar urpmi-0404e11b2a788856dc738e310982dca789f79974.tar.gz urpmi-0404e11b2a788856dc738e310982dca789f79974.tar.bz2 urpmi-0404e11b2a788856dc738e310982dca789f79974.tar.xz urpmi-0404e11b2a788856dc738e310982dca789f79974.zip |
move parallel_resolve_dependencies() which is now the same in parallel_ssh and parallel_ka_run
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/parallel.pm | 30 | ||||
-rw-r--r-- | urpm/parallel_ka_run.pm | 30 | ||||
-rw-r--r-- | urpm/parallel_ssh.pm | 30 |
3 files changed, 30 insertions, 60 deletions
diff --git a/urpm/parallel.pm b/urpm/parallel.pm index c8e06c43..912eec7b 100644 --- a/urpm/parallel.pm +++ b/urpm/parallel.pm @@ -202,6 +202,36 @@ sub parse_urpmq_output { } } +#- parallel resolve_dependencies +sub parallel_resolve_dependencies { + my ($parallel, $synthesis, $urpm, $state, $requested, %options) = @_; + + #- first propagate the synthesis file to all machines + propagate_file($parallel, $urpm, $synthesis); + + $parallel->{synthesis} = $synthesis; + + my $line = urpm::parallel::simple_resolve_dependencies($parallel, $urpm, $state, $requested, %options); + + #- execute urpmq to determine packages to install. + my ($cont, %chosen); + do { + $cont = 0; #- prepare to stop iteration. + #- the following state should be cleaned for each iteration. + delete $state->{selected}; + #- now try an iteration of urpmq. + $parallel->urpm_popen($urpm, 'urpmq', "--synthesis $synthesis -fduc $line " . join(' ', keys %chosen), sub { + my ($node, $s) = @_; + urpm::parallel::parse_urpmq_output($urpm, $state, $node, $s, \$cont, \%chosen, %options); + }); + #- check for internal error of resolution. + $cont == 1 and die "internal distant urpmq error on choice not taken"; + } while $cont; + + #- keep trace of what has been chosen finally (if any). + $parallel->{line} = join(' ', $line, keys %chosen); +} + #- compute command line of urpm? tools. sub simple_resolve_dependencies { my ($parallel, $urpm, $state, $requested, %options) = @_; diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm index 2c1ccad7..a933d90e 100644 --- a/urpm/parallel_ka_run.pm +++ b/urpm/parallel_ka_run.pm @@ -70,36 +70,6 @@ sub _run_mput { $? == 0 || $? == 256 or $urpm->{fatal}(1, N("mput failed, maybe a node is unreacheable")); } -#- parallel resolve_dependencies -sub parallel_resolve_dependencies { - my ($parallel, $synthesis, $urpm, $state, $requested, %options) = @_; - - #- first propagate the synthesis file to all machines - propagate_file($parallel, $urpm, $synthesis); - - $parallel->{synthesis} = $synthesis; - - my $line = urpm::parallel::simple_resolve_dependencies($parallel, $urpm, $state, $requested, %options); - - #- execute urpmq to determine packages to install. - my ($cont, %chosen); - do { - $cont = 0; #- prepare to stop iteration. - #- the following state should be cleaned for each iteration. - delete $state->{selected}; - #- now try an iteration of urpmq. - $parallel->urpm_popen($urpm, 'urpmq', "--synthesis $synthesis -fduc $line " . join(' ', keys %chosen), sub { - my ($node, $s) = @_; - urpm::parallel::parse_urpmq_output($urpm, $state, $node, $s, \$cont, \%chosen, %options); - }); - #- check for internal error of resolution. - $cont == 1 and die "internal distant urpmq error on choice not taken"; - } while $cont; - - #- keep trace of what has been chosen finally (if any). - $parallel->{line} = join(' ', $line, keys %chosen); -} - #- parallel install. sub parallel_install { my ($parallel, $urpm, undef, $install, $upgrade, %options) = @_; diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm index 68c37dfb..19ea8b2d 100644 --- a/urpm/parallel_ssh.pm +++ b/urpm/parallel_ssh.pm @@ -81,36 +81,6 @@ sub urpm_popen { } } -#- parallel resolve_dependencies -sub parallel_resolve_dependencies { - my ($parallel, $synthesis, $urpm, $state, $requested, %options) = @_; - - #- first propagate the synthesis file to all machines - propagate_file($parallel, $urpm, $synthesis); - - $parallel->{synthesis} = $synthesis; - - my $line = urpm::parallel::simple_resolve_dependencies($parallel, $urpm, $state, $requested, %options); - - #- execute urpmq to determine packages to install. - my ($cont, %chosen); - do { - $cont = 0; #- prepare to stop iteration. - #- the following state should be cleaned for each iteration. - delete $state->{selected}; - #- now try an iteration of urpmq. - $parallel->urpm_popen($urpm, "urpmq", "--synthesis $synthesis -fduc $line " . join(' ', keys %chosen), sub { - my ($node, $s) = @_; - urpm::parallel::parse_urpmq_output($urpm, $state, $node, $s, \$cont, \%chosen, %options); - }); - #- check for internal error of resolution. - $cont == 1 and die "internal distant urpmq error on choice not taken"; - } while $cont; - - #- keep trace of what has been chosen finally (if any). - $parallel->{line} = join(' ', $line, keys %chosen); -} - #- parallel install. sub parallel_install { my ($parallel, $urpm, undef, $install, $upgrade, %options) = @_; |