]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cacheiterators.h
Bump apt-inst SONAME to 2.0 to adjust for the ABI break in apt-pkg
[apt.git] / apt-pkg / cacheiterators.h
index 7e6adb92f473c6bbd65d042b3cccb700fa085588..f8321079aee5407ecb598a002b00f97abf237cc3 100644 (file)
@@ -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);
@@ -320,8 +329,8 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
           DependencyProxy const * operator->() const { return this; }
           DependencyProxy * operator->() { return this; }
        };
-       inline DependencyProxy operator->() const {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };}
-       inline DependencyProxy operator->() {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };}
+       inline DependencyProxy operator->() const {return (DependencyProxy) { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };}
+       inline DependencyProxy operator->() {return (DependencyProxy) { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };}
        void ReMap(void const * const oldMap, void const * const newMap)
        {
                Iterator<Dependency, DepIterator>::ReMap(oldMap, newMap);
@@ -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*) :