summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-05-22 16:07:49 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-05-22 16:07:49 +0200
commit800694cbf33e206935dc9e6e8fa6e9a036b8efad (patch)
tree1557d96ee0f463a020b11604146be66fb9809a31 /apt-pkg/depcache.cc
parent6c0c0387e616f8d04f00916fbd1fe899acd265cd (diff)
parent1351329e376a8dbe7780693693d0f3db0ec749fa (diff)
merged (and resolved a bunch of conflicts) of the debian-sid branch
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc35
1 files changed, 22 insertions, 13 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index fdfd1c713..56194e244 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -964,6 +964,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;
@@ -1146,9 +1153,8 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
}
/* This bit is for processing the possibilty of an install/upgrade
- fixing the problem */
- if (Start->Type != Dep::DpkgBreaks &&
- (DepState[Start->ID] & DepCVer) == DepCVer)
+ fixing the problem for "positive" dependencies */
+ if (Start.IsNegative() == false && (DepState[Start->ID] & DepCVer) == DepCVer)
{
APT::VersionList verlist;
pkgCache::VerIterator Cand = PkgState[Start.TargetPkg()->ID].CandidateVerIter(*this);
@@ -1159,7 +1165,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
pkgCache::VerIterator V = Prv.OwnerVer();
pkgCache::VerIterator Cand = PkgState[Prv.OwnerPkg()->ID].CandidateVerIter(*this);
if (Cand.end() == true || V != Cand ||
- VS().CheckDep(Cand.VerStr(), Start->CompareOp, Start.TargetVer()) == false)
+ VS().CheckDep(Prv.ProvideVersion(), Start->CompareOp, Start.TargetVer()) == false)
continue;
verlist.insert(Cand);
}
@@ -1192,13 +1198,13 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
}
continue;
}
-
- /* For conflicts we just de-install the package and mark as auto,
- Conflicts may not have or groups. For dpkg's Breaks we try to
- upgrade the package. */
- if (Start.IsNegative() == true)
+ /* Negative dependencies have no or-group
+ If the dependency isn't versioned, we try if an upgrade might solve the problem.
+ Otherwise we remove the offender if needed */
+ else if (Start.IsNegative() == true && Start->Type != pkgCache::Dep::Obsoletes)
{
SPtrArray<Version *> List = Start.AllTargets();
+ pkgCache::PkgIterator TrgPkg = Start.TargetPkg();
for (Version **I = List; *I != 0; I++)
{
VerIterator Ver(*this,*I);
@@ -1209,15 +1215,17 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
if (PkgState[Pkg->ID].InstallVer == 0)
continue;
- if (PkgState[Pkg->ID].CandidateVer != *I &&
- Start->Type == Dep::DpkgBreaks &&
+ if ((Start->Version != 0 || TrgPkg != Pkg) &&
+ PkgState[Pkg->ID].CandidateVer != PkgState[Pkg->ID].InstallVer &&
+ PkgState[Pkg->ID].CandidateVer != *I &&
MarkInstall(Pkg,true,Depth + 1, false, ForceImportantDeps) == true)
continue;
- else if (MarkDelete(Pkg,false,Depth + 1, false) == false)
+ else if ((Start->Type == pkgCache::Dep::Conflicts || Start->Type == pkgCache::Dep::DpkgBreaks) &&
+ MarkDelete(Pkg,false,Depth + 1, false) == false)
break;
}
continue;
- }
+ }
}
return Dep.end() == true;
@@ -1642,6 +1650,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