summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:51:44 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:51:44 +0000
commit999eddab7444c6157c0b2bddfb97fb33f813f981 (patch)
tree9f072f7a98e2ad07655d1e7d9f9cc5732a127e43
parent02dc9a7bfb4362f2acc14a29b55f233fb330f923 (diff)
downloadurpmi-999eddab7444c6157c0b2bddfb97fb33f813f981.tar
urpmi-999eddab7444c6157c0b2bddfb97fb33f813f981.tar.gz
urpmi-999eddab7444c6157c0b2bddfb97fb33f813f981.tar.bz2
urpmi-999eddab7444c6157c0b2bddfb97fb33f813f981.tar.xz
urpmi-999eddab7444c6157c0b2bddfb97fb33f813f981.zip
(_download_all, _install_src, _init_common_options,
_run_parallel_transaction) pass less arguments now that we have package scope variables which also fix a bug in newly introduced _install_src() where it would increment $nok w/o any actual side effect in run()
-rw-r--r--urpm/main_loop.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index 75454328..a7bd5e04 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -80,7 +80,7 @@ sub _download_packages {
}
sub _download_all {
- my ($urpm, $blists, $sources, $force, $callbacks) = @_;
+ my ($urpm, $blists, $sources, $callbacks) = @_;
if ($urpm->{options}{'download-all'}) {
$urpm->{cachedir} = $urpm->{'urpmi-root'} . $urpm->{options}{'download-all'};
urpm::init_cache_dir($urpm, $urpm->{cachedir});
@@ -130,7 +130,7 @@ sub _verify_rpm {
}
sub _install_src {
- my ($urpm, $nok, $transaction_sources_install, $transaction_sources) = @_;
+ my ($urpm, $transaction_sources_install, $transaction_sources) = @_;
if (my @l = grep { /\.src\.rpm$/ } values %$transaction_sources_install, values %$transaction_sources) {
my $rpm_opt = $options{verbose} >= 0 ? 'vh' : '';
system("rpm", "-i$rpm_opt", @l, ($urpm->{root} ? ("--root", $urpm->{root}) : @{[]}));
@@ -148,7 +148,7 @@ sub _install_src {
}
sub _continue_on_error {
- my ($urpm, $callbacks, $msgs, $error_sources, $formatted_errors, $ok, $exit_code) = @_;
+ my ($urpm, $callbacks, $msgs, $error_sources, $formatted_errors, $exit_code) = @_;
my $go_on;
if ($urpm->{options}{auto}) {
push @$formatted_errors, @$msgs;
@@ -181,7 +181,7 @@ sub _handle_removable_media {
}
sub _init_common_options {
- my ($urpm, $state, $callbacks, $test) = @_;
+ my ($urpm, $state, $callbacks) = @_;
(
urpm::install::options($urpm),
test => $test,
@@ -213,7 +213,7 @@ sub _log_installing {
}
sub _run_parallel_transaction {
- my ($urpm, $state, $test, $transaction_sources, $transaction_sources_install) = @_;
+ my ($urpm, $state, $transaction_sources, $transaction_sources_install) = @_;
$urpm->{print}(N("distributing %s", join(' ', values $transaction_sources_install, values $transaction_sources)));
#- no remove are handle here, automatically done by each distant node.
$urpm->{log}("starting distributed install");
@@ -248,7 +248,7 @@ sub run {
_handle_removable_media($urpm, $callbacks, $blists, \%sources);
if (exists $urpm->{options}{'download-all'}) {
- _download_all($urpm, $blists, \%sources, $force, $callbacks);
+ _download_all($urpm, $blists, \%sources, $callbacks);
}
#- now create transaction just before installation, this will save user impression of slowness.
@@ -288,7 +288,7 @@ sub run {
my ($error_sources, $msgs) = _download_packages($urpm, $callbacks, $transaction_blists, $transaction_sources);
if (@$error_sources) {
$nok++;
- last if !_continue_on_error($urpm, $callbacks, $msgs, $error_sources, \@formatted_errors, $ok, \$exit_code);
+ last if !_continue_on_error($urpm, $callbacks, $msgs, $error_sources, \@formatted_errors, \$exit_code);
}
$callbacks->{post_download} and $callbacks->{post_download}->();
@@ -304,7 +304,7 @@ sub run {
#- install source package only (whatever the user is root or not, but use rpm for that).
if ($install_src) {
- _install_src($urpm, $nok, \%transaction_sources_install, $transaction_sources);
+ _install_src($urpm, \%transaction_sources_install, $transaction_sources);
next;
}
@@ -321,7 +321,7 @@ sub run {
#- install/remove other packages
if (keys(%transaction_sources_install) || keys(%$transaction_sources) || $set->{remove}) {
if ($parallel) {
- _run_parallel_transaction($urpm, $state, $test, $transaction_sources, \%transaction_sources_install);
+ _run_parallel_transaction($urpm, $state, $transaction_sources, \%transaction_sources_install);
} else {
if ($options{verbose} >= 0) {
_log_installing($urpm, \%transaction_sources_install, $transaction_sources);
@@ -329,7 +329,7 @@ sub run {
my $to_remove = $urpm->{options}{'allow-force'} ? [] : $set->{remove} || [];
bug_log(scalar localtime(), " ", join(' ', values %transaction_sources_install, values %$transaction_sources), "\n");
$urpm->{log}("starting installing packages");
- my %install_options_common = _init_common_options($urpm, $state, $callbacks, $test);
+ my %install_options_common = _init_common_options($urpm, $state, $callbacks);
urpm::orphans::add_unrequested($urpm, $state) if !$test;