summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-09-19 12:04:02 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-09-19 12:04:02 +0200
commit021626db10191cc4388b0516687dbc51bba18820 (patch)
tree9fc672146579ad5823dfa3d8420bb1a0ae8b3bd1 /apt-pkg/pkgcache.cc
parent9abb228384185565478a137446a74e42af0c95b5 (diff)
* apt-pkg/pkgcache.cc:
- ignore negative dependencies applying in the same group for M-A:same packages on the real package name as self-conflicts
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc25
1 files changed, 23 insertions, 2 deletions
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;
}