summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-10-15 17:11:56 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-10-15 17:11:56 +0000
commit66e4e44ba0103fa81e3fe23d5d0b36cb460a5753 (patch)
treee85640036d4c737c423a7df0086b6c55a48f7ab8
parent4eec4e9c0d8d8a17939e9cbe1af71d24e92d5381 (diff)
downloadurpmi-66e4e44ba0103fa81e3fe23d5d0b36cb460a5753.tar
urpmi-66e4e44ba0103fa81e3fe23d5d0b36cb460a5753.tar.gz
urpmi-66e4e44ba0103fa81e3fe23d5d0b36cb460a5753.tar.bz2
urpmi-66e4e44ba0103fa81e3fe23d5d0b36cb460a5753.tar.xz
urpmi-66e4e44ba0103fa81e3fe23d5d0b36cb460a5753.zip
use references to return 2 distinct lists
-rw-r--r--urpm/main_loop.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index 248c0991..22da242a 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -94,7 +94,7 @@ sub download_packages {
join("\n", map { " $_->[0]" } @bad));
}
}
- (@error_sources, @msgs);
+ (\@error_sources, \@msgs);
}
if ($urpm->{options}{'download-all'}) {
@@ -108,8 +108,8 @@ if ($urpm->{options}{'download-all'}) {
}
}
- my (@error_sources) = download_packages($blists, \%sources);
- if (@error_sources) {
+ my ($error_sources) = download_packages($blists, \%sources);
+ if (@$error_sources) {
return 10;
}
}
@@ -147,20 +147,19 @@ foreach my $set (@{$state->{transaction} || []}) {
urpm::install::prepare_transaction($urpm, $set, $blists, \%sources);
#- first, filter out what is really needed to download for this small transaction.
- # BUG/FIXME: @error_sources takes all the arguments, @msgs is undef in any case
- my (@error_sources, @msgs) = download_packages($transaction_blists, $transaction_sources);
- if (@error_sources) {
+ my ($error_sources, $msgs) = download_packages($transaction_blists, $transaction_sources);
+ if (@$error_sources) {
$nok++;
my $go_on;
if ($urpm->{options}{auto}) {
- push @formatted_errors, @msgs;
+ push @formatted_errors, @$msgs;
} else {
$go_on = $callbacks->{ask_yes_or_no}->(
N("Installation failed"),
- join("\n\n", @msgs, N("Try to continue anyway?")));
+ join("\n\n", @$msgs, N("Try to continue anyway?")));
}
if (!$go_on) {
- my @missing = grep { $_->[1] eq 'missing' } @error_sources;
+ my @missing = grep { $_->[1] eq 'missing' } @$error_sources;
if (@missing) {
$exit_code = $ok ? 13 : 14;
}