From a0a6695515f8d8d7db3f52751d4d14f8266c286c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 15 Aug 2015 11:52:50 +0200 Subject: Add GetPriority(VerIterator) to pkgDepCache::Policy Also unify the case of considerFiles and ConsiderFiles to be ConsiderFiles in all cases. Gbp-Dch: ignore --- apt-pkg/depcache.cc | 2 ++ apt-pkg/depcache.h | 1 + apt-pkg/policy.cc | 4 ++-- apt-pkg/policy.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 367605826..8b2099992 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1780,6 +1780,8 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep) const // Policy::GetPriority - Get the priority of the package pin /*{{{*/ APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const &/*Pkg*/) { return 0; } +APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::VerIterator const &/*Ver*/, bool /*ConsiderFiles*/) +{ return 0; } APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const &/*File*/) { return 0; } /*}}}*/ diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 6a1d6f8b3..ba997c8a6 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -281,6 +281,7 @@ class pkgDepCache : protected pkgCache::Namespace virtual VerIterator GetCandidateVer(PkgIterator const &Pkg); virtual bool IsImportantDep(DepIterator const &Dep) const; virtual signed short GetPriority(PkgIterator const &Pkg); + virtual signed short GetPriority(VerIterator const &Ver, bool ConsiderFiles=true); virtual signed short GetPriority(PkgFileIterator const &File); virtual ~Policy() {}; diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 4711372bc..badf702ca 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -368,11 +368,11 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgIterator const &Pkg) return Pins[Pkg->ID].Priority; return 0; } -APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver, bool considerFiles) +APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver, bool ConsiderFiles) { if (VerPins[Ver->ID].Type != pkgVersionMatch::None) return VerPins[Ver->ID].Priority; - if (!considerFiles) + if (!ConsiderFiles) return 0; int priority = std::numeric_limits::min(); diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 5be6657e9..bb0ff7e27 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -80,7 +80,7 @@ class pkgPolicy : public pkgDepCache::Policy // Things for the cache interface. virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; - virtual signed short GetPriority(pkgCache::VerIterator const &Pkg, bool ConsiderFiles = true); + virtual signed short GetPriority(pkgCache::VerIterator const &Ver, bool ConsiderFiles = true) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::PkgFileIterator const &File) APT_OVERRIDE; bool InitDefaults(); -- cgit v1.2.3