summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-17 08:03:15 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-17 08:03:15 +0000
commit33c3afde0670250c7c3ed5ab5876a037d6a504b3 (patch)
tree87027ae7af8b1b0b428b7873852c1a5909aaa753
parent0965ac440bfce3230e3e8c47b4b8a36585d367db (diff)
downloadurpmi-33c3afde0670250c7c3ed5ab5876a037d6a504b3.tar
urpmi-33c3afde0670250c7c3ed5ab5876a037d6a504b3.tar.gz
urpmi-33c3afde0670250c7c3ed5ab5876a037d6a504b3.tar.bz2
urpmi-33c3afde0670250c7c3ed5ab5876a037d6a504b3.tar.xz
urpmi-33c3afde0670250c7c3ed5ab5876a037d6a504b3.zip
remove code duplication,
this fixes displaying "raw_message" errors in case of --nodeps/--force
-rw-r--r--urpm/main_loop.pm74
1 files changed, 20 insertions, 54 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index c9220a45..e0e7ef8d 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -217,6 +217,7 @@ foreach my $set (@{$state->{transaction} || []}) {
urpm::orphans::add_unrequested($urpm, $state);
+ install:
my @l = urpm::install::install($urpm,
$to_remove,
\%transaction_sources_install, $transaction_sources,
@@ -230,62 +231,27 @@ foreach my $set (@{$state->{transaction} || []}) {
#- Warning : the following message is parsed in urpm::parallel_*
my $msg = N("Installation failed:") . "\n" . join("\n", map { "\t$_" } @l) . "\n";
- my $retry;
- if ($no_question || !$urpm->{options}{'allow-nodeps'} && !$urpm->{options}{'allow-force'}) {
- print $msg;
- ++$urpm->{logger_id};
- } else {
- $retry = $callbacks->{ask_yes_or_no}->(N("Installation failed"),
- $msg . N("Try installation without checking dependencies? (y/N) "));
- }
- if (!$retry) {
- ++$nok;
- push @errors, @l;
- $fatal and last;
- } else {
- $urpm->{log}("starting installing packages without deps");
- @l = urpm::install::install($urpm,
- $to_remove,
- \%transaction_sources_install, $transaction_sources,
- nodeps => 1,
- %install_options_common,
- );
- if (@l) {
- #- Warning : the following message is parsed in urpm::parallel_*
- my $msg = N("Installation failed:") . "\n" . join("\n", map { "\t$_" } @l) . "\n";
- my $retry;
- if (!$urpm->{options}{'allow-force'}) {
- print $msg;
- ++$urpm->{logger_id};
- } else {
- $retry = $callbacks->{ask_yes_or_no}->(N("Installation failed"),
- $msg . N("Try harder to install (--force)? (y/N) "));
- }
- if (!$retry) {
- ++$nok;
- push @errors, @l;
- } else {
- $urpm->{log}("starting force installing packages without deps");
- @l = urpm::install::install($urpm,
- $to_remove,
- \%transaction_sources_install, $transaction_sources,
- nodeps => 1, force => 1,
- %install_options_common,
- );
- if (@l) {
- #- Warning : the following message is parsed in urpm::parallel_*
- print N("Installation failed:") . "\n" . join("\n", map { "\t$_" } @l), "\n";
- ++$nok;
- ++$urpm->{logger_id};
- push @errors, @l;
- } else {
- ++$ok;
- }
- }
- } else {
- ++$ok;
+ if (!$no_question && !$install_options_common{nodeps} && ($urpm->{options}{'allow-nodeps'} || $urpm->{options}{'allow-force'})) {
+ if ($callbacks->{ask_yes_or_no}->(N("Installation failed"),
+ $msg . N("Try installation without checking dependencies? (y/N) "))) {
+ $urpm->{log}("starting installing packages without deps");
+ $install_options_common{nodeps} = 1;
+ goto install;
+ }
+ } elsif (!$no_question && !$install_options_common{force} && $urpm->{options}{'allow-force'}) {
+ if ($callbacks->{ask_yes_or_no}->(N("Installation failed"),
+ $msg . N("Try harder to install (--force)? (y/N) "))) {
+ $urpm->{log}("starting force installing packages without deps");
+ $install_options_common{force} = 1;
+ goto install;
}
}
+ print $msg;
+ ++$urpm->{logger_id};
+
+ ++$nok;
+ push @errors, @l;
+ $fatal and last;
} else {
++$ok;
}