summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/depcache.cc2
-rw-r--r--apt-pkg/pkgcache.cc25
2 files changed, 24 insertions, 3 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 2656e9b42..deb8ec21f 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -346,7 +346,7 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res)
/* Check simple depends. A depends -should- never self match but
we allow it anyhow because dpkg does. Technically it is a packaging
bug. Conflicts may never self match */
- if (Dep.TargetPkg() != Dep.ParentPkg() || Dep.IsNegative() == false)
+ if (Dep.IsIgnorable(Res) == false)
{
PkgIterator Pkg = Dep.TargetPkg();
// Check the base package
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 353172d8a..1de33ff9b 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -690,8 +690,29 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End)
on virtual packages. */
bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &Pkg) const
{
- if (ParentPkg() == TargetPkg())
- return IsNegative();
+ if (IsNegative() == false)
+ return false;
+
+ pkgCache::PkgIterator PP = ParentPkg();
+ pkgCache::PkgIterator PT = TargetPkg();
+ if (PP->Group != PT->Group)
+ return false;
+ // self-conflict
+ if (PP == PT)
+ return true;
+ pkgCache::VerIterator PV = ParentVer();
+ // ignore group-conflict on a M-A:same package - but not our implicit dependencies
+ // so that we can have M-A:same packages conflicting with their own real name
+ if ((PV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ // Replaces: ${self}:other ( << ${binary:Version})
+ if (S->Type == pkgCache::Dep::Replaces && S->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0)
+ return false;
+ // Breaks: ${self}:other (!= ${binary:Version})
+ if (S->Type == pkgCache::Dep::DpkgBreaks && S->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0)
+ return false;
+ return true;
+ }
return false;
}