return;
PFPriority = new signed short[Owner->Head().PackageFileCount];
Pins = new Pin[Owner->Head().PackageCount];
+ VerPins = new Pin[Owner->Head().VersionCount];
for (unsigned long I = 0; I != Owner->Head().PackageCount; I++)
Pins[I].Type = pkgVersionMatch::None;
+ for (unsigned long I = 0; I != Owner->Head().VersionCount; I++)
+ VerPins[I].Type = pkgVersionMatch::None;
// The config file has a master override.
string DefRel = _config->Find("APT::Default-Release");
return Pins[Pkg->ID].Priority;
return 0;
}
+APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver)
+{
+ if (VerPins[Ver->ID].Type != pkgVersionMatch::None)
+ return VerPins[Ver->ID].Priority;
+ return 0;
+}
APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File)
{
return PFPriority[File->ID];
}
/*}}}*/
-pkgPolicy::~pkgPolicy() {delete [] PFPriority; delete [] Pins;}
+pkgPolicy::~pkgPolicy() {delete [] PFPriority; delete [] Pins; delete [] VerPins; }
};
Pin *Pins;
+ Pin *VerPins;
signed short *PFPriority;
std::vector<Pin> Defaults;
std::vector<PkgPin> Unmatched;
// Things for the cache interface.
virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg);
virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg);
+ virtual signed short GetPriority(pkgCache::VerIterator const &Pkg);
virtual signed short GetPriority(pkgCache::PkgFileIterator const &File);
bool InitDefaults();