summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-07 15:41:54 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-07 15:41:54 +0200
commitff94be47f5dbdcf99cea23fad8c9b992a8e5a67e (patch)
treedd57b80bf6ecd853fb3c6d5eab041630ecd1e75e /apt-pkg/algorithms.cc
parente39698a485e332742b935292dc4329abf19cbb53 (diff)
parent98c934f2723d63d00908803ad47ab1359081ec2d (diff)
Merge branch 'debian/sid' into bugfix/update-progress-reporting
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index a7b676660..608ec7fce 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -445,19 +445,22 @@ void pkgProblemResolver::MakeScores()
|| (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
Score += PrioEssentials;
- // We transform the priority
- if (Cache[I].InstVerIter(Cache)->Priority <= 5)
- Score += PrioMap[Cache[I].InstVerIter(Cache)->Priority];
-
+ pkgCache::VerIterator const InstVer = Cache[I].InstVerIter(Cache);
+ // We apply priorities only to downloadable packages, all others are prio:extra
+ // as an obsolete prio:standard package can't be that standard anymore…
+ if (InstVer->Priority <= pkgCache::State::Extra && InstVer.Downloadable() == true)
+ Score += PrioMap[InstVer->Priority];
+ else
+ Score += PrioMap[pkgCache::State::Extra];
+
/* This helps to fix oddball problems with conflicting packages
- on the same level. We enhance the score of installed packages
- if those are not obsolete
- */
+ on the same level. We enhance the score of installed packages
+ if those are not obsolete */
if (I->CurrentVer != 0 && Cache[I].CandidateVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable())
Score += PrioInstalledAndNotObsolete;
// propagate score points along dependencies
- for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; ++D)
+ for (pkgCache::DepIterator D = InstVer.DependsList(); D.end() == false; ++D)
{
if (DepMap[D->Type] == 0)
continue;