#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/sptr.h>
#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/versionmatch.h>
pkgVersioningSystem *vs = Cache->VS;
for (pkgCache::VerIterator ver = Pkg.VersionList(); ver.end() == false; ver++) {
- int priority = GetPriority(ver);
+ int priority = GetPriority(ver, true);
- if (priority == 0 || priority <= candPriority)
- continue;
+ if (priority == 0 || priority <= candPriority)
+ continue;
- // TODO: Maybe optimize to not compare versions
- if (!cur.end() && priority < 1000
- && (vs->CmpVersion(ver.VerStr(), cur.VerStr()) < 0))
- continue;
+ // TODO: Maybe optimize to not compare versions
+ if (!cur.end() && priority < 1000
+ && (vs->CmpVersion(ver.VerStr(), cur.VerStr()) < 0))
+ continue;
candPriority = priority;
cand = ver;
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();