From 53414a347dbf42513c94b2cd475591d83983ee2b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 4 Feb 2019 16:05:45 +0100 Subject: cacheiterators: Cleanup deprecated code --- apt-pkg/cacheiterators.h | 10 ---------- apt-pkg/pkgcache.cc | 40 +--------------------------------------- debian/libapt-pkg6.0.symbols | 3 --- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 20853061e..27daf4c43 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -164,9 +164,6 @@ class pkgCache::PkgIterator: public Iterator { // Accessors inline const char *Name() const { return Group().Name(); } - // Versions have sections - and packages can have different versions with different sections - // so this interface is broken by design. Run as fast as you can to Version.Section(). - APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char *Section() const; inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge || (S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);} inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;} @@ -177,7 +174,6 @@ class pkgCache::PkgIterator: public Iterator { inline DepIterator RevDependsList() const APT_PURE; inline PrvIterator ProvidesList() const APT_PURE; OkState State() const APT_PURE; - APT_DEPRECATED_MSG("This method does not respect apt_preferences! Use pkgDepCache::GetCandidateVersion(Pkg)") const char *CandVersion() const APT_PURE; const char *CurVersion() const APT_PURE; //Nice printable representation @@ -422,8 +418,6 @@ class pkgCache::RlsFileIterator : public Iterator inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;} inline bool Flagged(pkgCache::Flag::ReleaseFileFlags const flag) const {return (S->Flags & flag) == flag; } - APT_DEPRECATED_MSG("Can be remove without replacement; it is a no-op") - bool IsOk(); std::string RelStr(); // Constructors @@ -458,8 +452,6 @@ class pkgCache::PkgFileIterator : public Iterator inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;} inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;} - APT_DEPRECATED_MSG("Can be remove without replacement; it is a no-op") - bool IsOk(); std::string RelStr(); // Constructors @@ -525,7 +517,5 @@ inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const {return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);} inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const {return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);} -APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char * pkgCache::PkgIterator::Section() const - {return S->VersionList == 0 ? 0 : VersionList().Section();} /*}}}*/ #endif diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 9af8d2d13..5819a9b4a 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -560,19 +560,6 @@ pkgCache::PkgIterator::OkState pkgCache::PkgIterator::State() const return NeedsNothing; } /*}}}*/ -// PkgIterator::CandVersion - Returns the candidate version string /*{{{*/ -// --------------------------------------------------------------------- -/* Return string representing of the candidate version. */ -const char * -pkgCache::PkgIterator::CandVersion() const -{ - //TargetVer is empty, so don't use it. - VerIterator version = pkgPolicy(Owner).GetCandidateVer(*this); - if (version.IsGood()) - return version.VerStr(); - return 0; -} - /*}}}*/ // PkgIterator::CurVersion - Returns the current version string /*{{{*/ // --------------------------------------------------------------------- /* Return string representing of the current version. */ @@ -598,15 +585,10 @@ operator<<(std::ostream& out, pkgCache::PkgIterator Pkg) return out << "invalid package"; string current = string(Pkg.CurVersion() == 0 ? "none" : Pkg.CurVersion()); -APT_IGNORE_DEPRECATED_PUSH - string candidate = string(Pkg.CandVersion() == 0 ? "none" : Pkg.CandVersion()); -APT_IGNORE_DEPRECATED_POP string newest = string(Pkg.VersionList().end() ? "none" : Pkg.VersionList().VerStr()); out << Pkg.Name() << " [ " << Pkg.Arch() << " ] < " << current; - if (current != candidate) - out << " -> " << candidate; - if ( newest != "none" && candidate != newest) + if ( newest != "none") out << " | " << newest; if (Pkg->VersionList == 0) out << " > ( none )"; @@ -1007,16 +989,6 @@ const char * pkgCache::VerIterator::MultiArchType() const return "none"; } /*}}}*/ -// RlsFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ -// --------------------------------------------------------------------- -/* This stats the file and compares its stats with the ones that were - stored during generation. Date checks should probably also be - included here. */ -bool pkgCache::RlsFileIterator::IsOk() -{ - return true; -} - /*}}}*/ // RlsFileIterator::RelStr - Return the release string /*{{{*/ string pkgCache::RlsFileIterator::RelStr() { @@ -1034,16 +1006,6 @@ string pkgCache::RlsFileIterator::RelStr() return Res; } /*}}}*/ -// PkgFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ -// --------------------------------------------------------------------- -/* This stats the file and compares its stats with the ones that were - stored during generation. Date checks should probably also be - included here. */ -bool pkgCache::PkgFileIterator::IsOk() -{ - return true; -} - /*}}}*/ string pkgCache::PkgFileIterator::RelStr() /*{{{*/ { std::string Res; diff --git a/debian/libapt-pkg6.0.symbols b/debian/libapt-pkg6.0.symbols index a37d39d8e..fc9ed3b4b 100644 --- a/debian/libapt-pkg6.0.symbols +++ b/debian/libapt-pkg6.0.symbols @@ -374,7 +374,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"pkgCache::DepIterator::operator++()@APTPKG_6.0" 0.8.0 (c++)"pkgCache::GrpIterator::operator++()@APTPKG_6.0" 0.8.0 (c++)"pkgCache::PkgIterator::operator++()@APTPKG_6.0" 0.8.0 - (c++)"pkgCache::PkgFileIterator::IsOk()@APTPKG_6.0" 0.8.0 (c++)"pkgCache::PkgFileIterator::RelStr[abi:cxx11]()@APTPKG_6.0" 0.8.0 (c++)"pkgCache::ReMap(bool const&)@APTPKG_6.0" 0.8.0 (c++)"pkgCache::Header::Header()@APTPKG_6.0" 0.8.0 @@ -468,7 +467,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"pkgCache::GrpIterator::FindPkg(std::__cxx11::basic_string, std::allocator >) const@APTPKG_6.0" 0.8.0 (c++)"pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const&) const@APTPKG_6.0" 0.8.0 (c++)"pkgCache::PkgIterator::CurVersion() const@APTPKG_6.0" 0.8.0 - (c++)"pkgCache::PkgIterator::CandVersion() const@APTPKG_6.0" 0.8.0 (c++)"pkgCache::PkgIterator::State() const@APTPKG_6.0" 0.8.0 (c++)"pkgCache::VerIterator::CompareVer(pkgCache::VerIterator const&) const@APTPKG_6.0" 0.8.0 (c++)"pkgCache::VerIterator::NewestFile() const@APTPKG_6.0" 0.8.0 @@ -1234,7 +1232,6 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER# (c++)"pkgCache::DepIterator::IsImplicit() const@APTPKG_6.0" 1.1~exp9 (c++)"pkgCacheFile::pkgCacheFile(pkgDepCache*)@APTPKG_6.0" 1.1~exp9 (c++)"pkgCache::PkgIterator::FullName[abi:cxx11](bool const&) const@APTPKG_6.0" 1.1~exp9 - (c++)"pkgCache::RlsFileIterator::IsOk()@APTPKG_6.0" 1.1~exp9 (c++)"pkgCache::RlsFileIterator::RelStr[abi:cxx11]()@APTPKG_6.0" 1.1~exp9 (c++)"pkgCdrom::~pkgCdrom()@APTPKG_6.0" 1.1~exp9 (c++)"pkgCdrom::pkgCdrom()@APTPKG_6.0" 1.1~exp9 -- cgit v1.2.3