diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-03-13 14:21:00 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-03-13 14:21:00 +0100 |
commit | b829fb2602a506a01cb2b3fd371e975784d4377c (patch) | |
tree | a0999795c61b95e3a9ec2cf30575e22e1b4d7337 /apt-pkg/algorithms.cc | |
parent | b3887af24029cdc6179470fcb8587fff39a3eee9 (diff) | |
parent | 544cc111be38bd0a3dfc887da3a70610b3cabe9e (diff) |
merged from debian-experimental2
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r-- | apt-pkg/algorithms.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index c337ace87..8beb2d51c 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -471,7 +471,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache) // ProblemResolver::pkgProblemResolver - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : Cache(*pCache) +pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : d(NULL), Cache(*pCache) { // Allocate memory unsigned long Size = Cache.Head().PackageCount; @@ -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; |