summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-04-23 17:46:11 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-04-23 17:46:11 +0200
commit074da0970c68879d548b6b4f64d0da7f38151248 (patch)
tree679693cf25fd075c50e2323082b2fab5302f953b /apt-pkg
parent849e64ac558c5c72a65b6ee0098fdfc538eca5e6 (diff)
* apt-pkg/depcache.cc:
- clearly separate 'positive' and 'negative' dependencies and their upgrade-resolution tries in MarkInstall and especially don't treat Conflicts differently compared to Breaks here
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/depcache.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 1eea55560..daf7c8c4d 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1152,9 +1152,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);
@@ -1198,13 +1197,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);
@@ -1215,15 +1214,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;