diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-06-14 14:28:35 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-06-14 14:28:35 +0200 |
commit | a15f2d0deeb90ce79903823e9317d4fa3e47acff (patch) | |
tree | 75799afb72d0207eae1c57555a60529e3bb94e60 /apt-private/private-cacheset.cc | |
parent | d13040190a8542eb8dd5611de1d22d111cfc6b1c (diff) |
Remove deprecated cacheset methods
This mostly turns them private and then overrides the public
version with the switch, as recommended.
Diffstat (limited to 'apt-private/private-cacheset.cc')
-rw-r--r-- | apt-private/private-cacheset.cc | 65 |
1 files changed, 60 insertions, 5 deletions
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc index 95a16f8ba..98b842adb 100644 --- a/apt-private/private-cacheset.cc +++ b/apt-private/private-cacheset.cc @@ -188,6 +188,25 @@ CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &pout) : { explicitlyNamed = true; } +void CacheSetHelperAPTGet::showPackageSelection(pkgCache::PkgIterator const &pkg, enum PkgSelector const select, + std::string const &pattern) +{ + switch (select) + { + case REGEX: + showRegExSelection(pkg, pattern); + break; + case TASK: + showTaskSelection(pkg, pattern); + break; + case FNMATCH: + showFnmatchSelection(pkg, pattern); + break; + default: + APT::CacheSetHelper::showPackageSelection(pkg, select, pattern); + break; + } +} void CacheSetHelperAPTGet::showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), @@ -206,13 +225,22 @@ void CacheSetHelperAPTGet::showRegExSelection(pkgCache::PkgIterator const &Pkg, Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } -void CacheSetHelperAPTGet::showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver, - std::string const &ver, bool const /*verIsRel*/) +void CacheSetHelperAPTGet::showVersionSelection(pkgCache::PkgIterator const &Pkg, + pkgCache::VerIterator const &Ver, enum VerSelector const select, std::string const &pattern) { - if (ver == Ver.VerStr()) - return; - selectedByRelease.push_back(make_pair(Ver, ver)); + switch (select) + { + case RELEASE: + case VERSIONNUMBER: + if (pattern == Ver.VerStr()) + return; + selectedByRelease.push_back(make_pair(Ver, pattern)); + break; + default: + return APT::CacheSetHelper::showVersionSelection(Pkg, Ver, select, pattern); + } } + bool CacheSetHelperAPTGet::showVirtualPackageErrors(pkgCacheFile &Cache) { if (virtualPkgs.empty() == true) @@ -268,6 +296,33 @@ bool CacheSetHelperAPTGet::showVirtualPackageErrors(pkgCacheFile &Cache) } return false; } +pkgCache::VerIterator CacheSetHelperAPTGet::canNotGetVersion(enum VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) +{ + switch (select) + { + case NEWEST: + return canNotFindNewestVer(Cache, Pkg); + case CANDIDATE: + return canNotFindCandidateVer(Cache, Pkg); + default: + return APT::CacheSetHelper::canNotGetVersion(select, Cache, Pkg); + } +} +void CacheSetHelperAPTGet::canNotFindVersion(enum VerSelector const select, APT::VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) +{ + switch (select) + { + case NEWEST: + canNotFindNewestVer(Cache, Pkg); + break; + case CANDIDATE: + canNotFindCandidateVer(Cache, Pkg); + break; + default: + return APT::CacheSetHelper::canNotFindVersion(select, vci, Cache, Pkg); + } +} + pkgCache::VerIterator CacheSetHelperAPTGet::canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE); |