diff options
Diffstat (limited to '')
-rw-r--r-- | apt-pkg/solver3.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index 9a9d67a..33067a0 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -104,8 +104,9 @@ class Solver return verStates[V->ID]; } - std::vector<char> verObsolete; - bool Obsolete(pkgCache::VerIterator ver); + mutable std::vector<char> pkgObsolete; + bool Obsolete(pkgCache::PkgIterator pkg) const; + bool ObsoletedByNewerSourceVersion(pkgCache::VerIterator cand) const; // \brief Heap of the remaining work. // @@ -219,6 +220,16 @@ struct APT::Solver::Reason { return IsVersion ? map_pointer<pkgCache::Version>{(uint32_t)MapPtr} : 0; } + // \brief Return the package iterator if storing a package, or an empty one + pkgCache::PkgIterator Pkg(pkgCache &cache) const + { + return IsVersion ? pkgCache::PkgIterator() : pkgCache::PkgIterator(cache, cache.PkgP + Pkg()); + } + // \brief Return the version iterator if storing a package, or an empty end. + pkgCache::VerIterator Ver(pkgCache &cache) const + { + return IsVersion ? pkgCache::VerIterator(cache, cache.VerP + Ver()) : pkgCache::VerIterator(); + } // \brief Check if there is no reason. bool empty() const { |