summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-08-15 11:52:50 +0200
committerJulian Andres Klode <jak@debian.org>2015-08-15 11:54:08 +0200
commita0a6695515f8d8d7db3f52751d4d14f8266c286c (patch)
tree5d104d38a5af7abf75ebe1e5b4dedbd66859598d
parent91e42c2b4e9a6e8c7c1db29e9d1606741d251ca0 (diff)
Add GetPriority(VerIterator) to pkgDepCache::Policy
Also unify the case of considerFiles and ConsiderFiles to be ConsiderFiles in all cases. Gbp-Dch: ignore
-rw-r--r--apt-pkg/depcache.cc2
-rw-r--r--apt-pkg/depcache.h1
-rw-r--r--apt-pkg/policy.cc4
-rw-r--r--apt-pkg/policy.h2
4 files changed, 6 insertions, 3 deletions
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<int>::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();