summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-01-08 17:56:32 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2013-01-08 17:56:32 +0100
commitc0751c067f54de860a6372022ad64b9518c91391 (patch)
tree760c4b7b7679e80930f1c2340eea408a588f204f /apt-pkg/algorithms.cc
parentd663a4c8a8723ae4936d10d0a98ea2c05a29cbc4 (diff)
parent84de0ceaad7e8c74f47e06bccba83b1b310262b6 (diff)
fix pkgProblemResolver::Scores, thanks to Paul Wise.
Closes: #697577
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 8cd9d4c6e..7fcd9f0db 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -550,11 +550,14 @@ void pkgProblemResolver::MakeScores()
unsigned long Size = Cache.Head().PackageCount;
memset(Scores,0,sizeof(*Scores)*Size);
- // Important Required Standard Optional Extra
+ // Maps to pkgCache::State::VerPriority
+ // which is "Important Required Standard Optional Extra"
+ // (yes, that is confusing, the order of pkgCache::State::VerPriority
+ // needs to be adjusted but that requires a ABI break)
int PrioMap[] = {
0,
- _config->FindI("pkgProblemResolver::Scores::Important",3),
- _config->FindI("pkgProblemResolver::Scores::Required",2),
+ _config->FindI("pkgProblemResolver::Scores::Important",2),
+ _config->FindI("pkgProblemResolver::Scores::Required",3),
_config->FindI("pkgProblemResolver::Scores::Standard",1),
_config->FindI("pkgProblemResolver::Scores::Optional",-1),
_config->FindI("pkgProblemResolver::Scores::Extra",-2)
@@ -568,11 +571,11 @@ void pkgProblemResolver::MakeScores()
if (_config->FindB("Debug::pkgProblemResolver::ShowScores",false) == true)
clog << "Settings used to calculate pkgProblemResolver::Scores::" << endl
- << " Important => " << PrioMap[1] << endl
- << " Required => " << PrioMap[2] << endl
- << " Standard => " << PrioMap[3] << endl
- << " Optional => " << PrioMap[4] << endl
- << " Extra => " << PrioMap[5] << endl
+ << " Required => " << PrioMap[pkgCache::State::Required] << endl
+ << " Important => " << PrioMap[pkgCache::State::Important] << endl
+ << " Standard => " << PrioMap[pkgCache::State::Standard] << endl
+ << " Optional => " << PrioMap[pkgCache::State::Optional] << endl
+ << " Extra => " << PrioMap[pkgCache::State::Extra] << endl
<< " Essentials => " << PrioEssentials << endl
<< " InstalledAndNotObsolete => " << PrioInstalledAndNotObsolete << endl
<< " Depends => " << PrioDepends << endl