aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-05-21 11:19:19 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-05-21 11:19:19 +0000
commit48b97aa2c6cdb5d3a705df336d4e46467399cb13 (patch)
tree7ea771f9f8344f6f1449d1ff97d488cbf6e59a41
parent21da15a9187a86dc7211235daececb338e3e2ef8 (diff)
downloadperl-URPM-48b97aa2c6cdb5d3a705df336d4e46467399cb13.tar
perl-URPM-48b97aa2c6cdb5d3a705df336d4e46467399cb13.tar.gz
perl-URPM-48b97aa2c6cdb5d3a705df336d4e46467399cb13.tar.bz2
perl-URPM-48b97aa2c6cdb5d3a705df336d4e46467399cb13.tar.xz
perl-URPM-48b97aa2c6cdb5d3a705df336d4e46467399cb13.zip
Allow urpmi to downgrade packages if it was invoked with --allow-force
-rw-r--r--URPM/Resolve.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index cc82462..98fca43 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -531,7 +531,15 @@ sub resolve_requested {
if ($p->name eq $pkg->name) {
#- all packages older than the current one are obsoleted,
#- the others are simply removed (the result is the same).
- if ($satisfied || $comparison > 0) {
+ if ($comparison > 0) {
+ #- installed package is newer
+ #- remove this package from the list of packages to install,
+ #- unless urpmi was invoked with --allow-force (in which
+ #- case rpm could be invoked with --oldpackage)
+ if (!$urpm->{options}{'allow-force'}) {
+ $urpm->disable_selected($db, $state, $pkg);
+ }
+ } elsif ($satisfied) {
$rv->{obsoleted} = 1;
} else {
$rv->{closure}{$pkg->fullname} = { old_requested => 1 };