diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-03-06 14:07:11 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-03-06 14:07:11 +0000 |
commit | e6ee6cabe43d90228c29cfa90109d3d965d115f0 (patch) | |
tree | d4b9c906c08f63eaf2840691b7fd25423f0907de | |
parent | ea56f6b3a0360306e625d248632f93a4c7d4c145 (diff) | |
download | perl-URPM-e6ee6cabe43d90228c29cfa90109d3d965d115f0.tar perl-URPM-e6ee6cabe43d90228c29cfa90109d3d965d115f0.tar.gz perl-URPM-e6ee6cabe43d90228c29cfa90109d3d965d115f0.tar.bz2 perl-URPM-e6ee6cabe43d90228c29cfa90109d3d965d115f0.tar.xz perl-URPM-e6ee6cabe43d90228c29cfa90109d3d965d115f0.zip |
rewrite
-rw-r--r-- | URPM/Resolve.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index de850c2..ddfd656 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1113,13 +1113,14 @@ sub request_packages_to_upgrade { #- first try with package using the same name. #- this will avoid selecting all packages obsoleting an old one. if (my $pkg = $names{$pn}) { - if (!$pkg->flag_upgrade && !$pkg->flag_installed) { - $pkg->set_flag_installed; #- there is at least one package installed (whatever its version). + my $may_upgrade = $pkg->flag_upgrade || #- it is has already been flagged upgradable + (!$pkg->flag_installed && do { + $pkg->set_flag_installed; #- there is at least one package installed (whatever its version). + 1; + }); + if ($may_upgrade && $pkg->compare_pkg($p) > 0) { + #- keep in mind the package is requested. $pkg->set_flag_upgrade; - } - $pkg->flag_upgrade and $pkg->set_flag_upgrade($pkg->compare_pkg($p) > 0); - #- keep in mind the package is requested. - if ($pkg->flag_upgrade) { $requested{$pn} = undef; } else { delete $names{$pn}; |