return Pref;
}
-
-// Policy::GetCandidateVer - Get the candidate install version /*{{{*/
+ /*}}}*/
+// Policy::GetCandidateVerNew - Get the candidate install version /*{{{*/
// ---------------------------------------------------------------------
/* Evaluate the package pins and the default list to deteremine what the
best package is. */
int candPriority = -1;
pkgVersioningSystem *vs = Cache->VS;
- for (pkgCache::VerIterator ver = Pkg.VersionList(); ver.end() == false; ver++) {
+ for (pkgCache::VerIterator ver = Pkg.VersionList(); ver.end() == false; ++ver) {
int priority = GetPriority(ver, true);
if (priority == 0 || priority <= candPriority)
// Find matching version(s) and copy the pin into it
pkgVersionMatch Match(P->Data,P->Type);
- for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() != true; Ver++)
+ for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() != true; ++Ver)
{
if (Match.VersionMatches(Ver)) {
Pin *VP = VerPins + Ver->ID;
return true;
FileFd Fd(File,FileFd::ReadOnly);
- pkgTagFile TF(&Fd);
- if (_error->PendingError() == true)
+ pkgTagFile TF(&Fd, pkgTagFile::SUPPORT_COMMENTS);
+ if (Fd.IsOpen() == false || Fd.Failed())
return false;
- pkgUserTagSection Tags;
+ pkgTagSection Tags;
while (TF.Step(Tags) == true)
{
// can happen when there are only comments in a record
}
for (; Word != End && isspace(*Word) != 0; Word++);
- int priority = Tags.FindI("Pin-Priority", 0);
+ _error->PushToStack();
+ int const priority = Tags.FindI("Pin-Priority", 0);
+ bool const newError = _error->PendingError();
+ _error->MergeWithStack();
if (priority < std::numeric_limits<short>::min() ||
priority > std::numeric_limits<short>::max() ||
- _error->PendingError()) {
+ newError) {
return _error->Error(_("%s: Value %s is outside the range of valid pin priorities (%d to %d)"),
File.c_str(), Tags.FindS("Pin-Priority").c_str(),
std::numeric_limits<short>::min(),