diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-07-16 11:15:25 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-10 17:27:58 +0200 |
commit | 8c7af4d4c95d0423fbd0f3baa979792504f4f45f (patch) | |
tree | 545fdadc93065512092790b9517b77e4501151e8 /apt-pkg/cacheiterators.h | |
parent | dfe66c72ffc010e019e96b35154e1ad4ab506a6e (diff) |
hide implicit deps in apt-cache again by default
Before MultiArch implicits weren't a thing, so they were hidden by
default by definition. Adding them for MultiArch solved many problems,
but having no reliable way of detecting which dependency (and provides)
is implicit or not causes problems everytime we want to output
dependencies without confusing our observers with unneeded
implementation details.
The really notworthy point here is actually that we keep now a better
record of how a dependency came to be so that we can later reason about
it more easily, but that is hidden so deep down in the library internals
that change is more the problems it solves than the change itself.
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r-- | apt-pkg/cacheiterators.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 7e6adb92f..1063d6f9e 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -295,7 +295,16 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> { bool IsNegative() const APT_PURE; bool IsIgnorable(PrvIterator const &Prv) const APT_PURE; bool IsIgnorable(PkgIterator const &Pkg) const APT_PURE; - bool IsMultiArchImplicit() const APT_PURE; + /* MultiArch can be translated to SingleArch for an resolver and we did so, + by adding dependencies to help the resolver understand the problem, but + sometimes it is needed to identify these to ignore them… */ + inline bool IsMultiArchImplicit() const APT_PURE { + return (S2->CompareOp & pkgCache::Dep::MultiArchImplicit) == pkgCache::Dep::MultiArchImplicit; + } + /* This covers additionally negative dependencies, which aren't arch-specific, + but change architecture nontheless as a Conflicts: foo does applies for all archs */ + bool IsImplicit() const APT_PURE; + bool IsSatisfied(VerIterator const &Ver) const APT_PURE; bool IsSatisfied(PrvIterator const &Prv) const APT_PURE; void GlobOr(DepIterator &Start,DepIterator &End); @@ -367,7 +376,12 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> { inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);} inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);} - bool IsMultiArchImplicit() const APT_PURE; + /* MultiArch can be translated to SingleArch for an resolver and we did so, + by adding provides to help the resolver understand the problem, but + sometimes it is needed to identify these to ignore them… */ + bool IsMultiArchImplicit() const APT_PURE + { return (S->Flags & pkgCache::Flag::MultiArchImplicit) == pkgCache::Flag::MultiArchImplicit; } + inline PrvIterator() : Iterator<Provides, PrvIterator>(), Type(PrvVer) {} inline PrvIterator(pkgCache &Owner, Provides *Trg, Version*) : |