summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2012-03-05 15:12:31 +0100
committerJulian Andres Klode <jak@debian.org>2012-03-05 15:12:31 +0100
commitc520086906f0479d04946f926e3d2dd30df82945 (patch)
treeab56d53dbffb1f12ef0b675803603de3dc6f85f7 /apt-pkg/algorithms.cc
parentfb805d80bfc6027e2242796dbda306e712cfac09 (diff)
* Treat the Important flag like the Essential flag with two differences:
- No Immediate configuration (see above) - Not automatically installed during dist-upgrade
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index c337ace87..ef9b5411d 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -556,7 +556,8 @@ void pkgProblemResolver::MakeScores()
essantial package above most other packages but low enough
to allow an obsolete essential packages to be removed by
a conflicts on a powerfull normal package (ie libc6) */
- if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
+ if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential
+ || (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
Score += PrioEssentials;
// We transform the priority
@@ -631,7 +632,8 @@ void pkgProblemResolver::MakeScores()
{
if ((Flags[I->ID] & Protected) != 0)
Scores[I->ID] += AddProtected;
- if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
+ if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential ||
+ (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
Scores[I->ID] += AddEssential;
}
}
@@ -1430,6 +1432,13 @@ static int PrioComp(const void *A,const void *B)
if ((L.ParentPkg()->Flags & pkgCache::Flag::Essential) != pkgCache::Flag::Essential &&
(R.ParentPkg()->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
return -1;
+
+ if ((L.ParentPkg()->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important &&
+ (R.ParentPkg()->Flags & pkgCache::Flag::Important) != pkgCache::Flag::Important)
+ return 1;
+ if ((L.ParentPkg()->Flags & pkgCache::Flag::Important) != pkgCache::Flag::Important &&
+ (R.ParentPkg()->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
+ return -1;
if (L->Priority != R->Priority)
return R->Priority - L->Priority;