summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/algorithms.cc13
-rw-r--r--apt-pkg/depcache.cc8
-rw-r--r--apt-pkg/packagemanager.cc6
-rw-r--r--debian/changelog3
4 files changed, 26 insertions, 4 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;
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 9449c7306..1eea55560 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -963,6 +963,13 @@ struct CompareProviders {
else if ((B->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
return true;
}
+ if ((A->Flags & pkgCache::Flag::Important) != (B->Flags & pkgCache::Flag::Important))
+ {
+ if ((A->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
+ return false;
+ else if ((B->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important)
+ return true;
+ }
// higher priority seems like a good idea
if (AV->Priority != BV->Priority)
return AV->Priority < BV->Priority;
@@ -1641,6 +1648,7 @@ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc)
{
if(!(PkgState[p->ID].Flags & Flag::Auto) ||
(p->Flags & Flag::Essential) ||
+ (p->Flags & Flag::Important) ||
userFunc.InRootSet(p) ||
// be nice even then a required package violates the policy (#583517)
// and do the full mark process also for required packages
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 4eb539579..d8e9621a4 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -486,7 +486,8 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
// Essential packages get special treatment
bool IsEssential = false;
- if ((Pkg->Flags & pkgCache::Flag::Essential) != 0)
+ if ((Pkg->Flags & pkgCache::Flag::Essential) != 0 ||
+ (Pkg->Flags & pkgCache::Flag::Important) != 0)
IsEssential = true;
/* Check for packages that are the dependents of essential packages and
@@ -496,7 +497,8 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
for (DepIterator D = Pkg.RevDependsList(); D.end() == false &&
IsEssential == false; ++D)
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
- if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
+ if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0 ||
+ (D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0)
IsEssential = true;
}
diff --git a/debian/changelog b/debian/changelog
index 9ecf363c1..0b23e7a7e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,9 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
- Set the Essential flag on APT instead of only Important
* apt-pkg/packagemanager.cc:
- Do not use immediate configuration for packages with the Important flag
+ * Treat the Important flag like the Essential flag with two differences:
+ - No Immediate configuration (see above)
+ - Not automatically installed during dist-upgrade
-- David Kalnischkies <kalnischkies@gmail.com> Mon, 30 Jan 2012 19:17:09 +0100