From 48b97aa2c6cdb5d3a705df336d4e46467399cb13 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 21 May 2004 11:19:19 +0000 Subject: Allow urpmi to downgrade packages if it was invoked with --allow-force --- URPM/Resolve.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'URPM/Resolve.pm') 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 }; -- cgit v1.2.1