bool operator () (const pkgCache::VerIterator &v_lhs,
const pkgCache::VerIterator &v_rhs)
{
- pkgCache::DescFile *A = v_lhs.TranslatedDescription().FileList();
- pkgCache::DescFile *B = v_rhs.TranslatedDescription().FileList();
- if (A == 0 && B == 0)
- return false;
+ pkgCache::DescFile const *A = NULL;
+ pkgCache::DescFile const *B = NULL;
+ if (v_lhs->DescriptionList != 0)
+ A = v_lhs.TranslatedDescription().FileList();
+ if (v_rhs->DescriptionList != 0)
+ B = v_rhs.TranslatedDescription().FileList();
+
+ if (A == 0 && B == 0)
+ return false;
if (A == 0)
return true;
public:
APT::PackageSet virtualPkgs;
- virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- virtualPkgs.insert(Pkg);
- return CacheSetHelper::canNotFindCandidateVer(Cache, Pkg);
- }
-
- virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- virtualPkgs.insert(Pkg);
- return CacheSetHelper::canNotFindNewestVer(Cache, Pkg);
+ virtual pkgCache::VerIterator canNotGetVersion(enum CacheSetHelper::VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE {
+ if (select == NEWEST || select == CANDIDATE || select == ALL)
+ virtualPkgs.insert(Pkg);
+ return CacheSetHelper::canNotGetVersion(select, Cache, Pkg);
}
- virtual void canNotFindAllVer(APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- virtualPkgs.insert(Pkg);
- CacheSetHelper::canNotFindAllVer(vci, Cache, Pkg);
+ virtual void canNotFindVersion(enum CacheSetHelper::VerSelector const select, APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE {
+ if (select == NEWEST || select == CANDIDATE || select == ALL)
+ virtualPkgs.insert(Pkg);
+ return CacheSetHelper::canNotFindVersion(select, vci, Cache, Pkg);
}
CacheSetHelperVirtuals(bool const ShowErrors = true, GlobalError::MsgType const &ErrorType = GlobalError::NOTICE) : CacheSetHelper(ShowErrors, ErrorType) {}
explicitlyNamed = true;
}
- virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) {
+ virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE {
ioprintf(out, _("Note, selecting '%s' for task '%s'\n"),
Pkg.FullName(true).c_str(), pattern.c_str());
explicitlyNamed = false;
}
- virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) {
+ virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE {
ioprintf(out, _("Note, selecting '%s' for glob '%s'\n"),
Pkg.FullName(true).c_str(), pattern.c_str());
explicitlyNamed = false;
}
- virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) {
+ virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE {
ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"),
Pkg.FullName(true).c_str(), pattern.c_str());
explicitlyNamed = false;
}
virtual void showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver,
- std::string const &ver, bool const /*verIsRel*/) {
+ std::string const &ver, bool const /*verIsRel*/) APT_OVERRIDE {
if (ver == Ver.VerStr())
return;
selectedByRelease.push_back(make_pair(Ver, ver));
return false;
}
- virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::CANDIDATE);
+ virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE {
+ APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE);
if (verset.empty() == false)
return *(verset.begin());
else if (ShowError == true) {
return pkgCache::VerIterator(Cache, 0);
}
- virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
+ virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE {
if (Pkg->ProvidesList != 0)
{
- APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::NEWEST);
+ APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::NEWEST);
if (verset.empty() == false)
return *(verset.begin());
if (ShowError == true)
}
APT::VersionSet tryVirtualPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg,
- APT::VersionSet::Version const &select) {
+ CacheSetHelper::VerSelector const select) {
/* This is a pure virtual package and there is a single available
candidate providing it. */
if (unlikely(Cache[Pkg].CandidateVer != 0) || Pkg->ProvidesList == 0)