X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a2d40703e4a5590a689ace4466f92e590434944d..4cd86fc61960404ef7dd8a474c2dff2002016824:/apt-pkg/cacheiterators.h diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index b0c02d4a2..fe798799c 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -161,10 +161,12 @@ 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. It used to return the section of the "first parsed - // package stanza", but as this can potentially be anything it now returns the section of the - // newest version instead (if any). aka: Run as fast as you can to Version.Section(). - APT_DEPRECATED const char *Section() const; + // so this interface is broken by design. Run as fast as you can to Version.Section(). + APT_DEPRECATED inline const char *Section() const { + APT_IGNORE_DEPRECATED_PUSH + return S->Section == 0?0:Owner->StrP + S->Section; + APT_IGNORE_DEPRECATED_POP + } 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;} @@ -215,12 +217,14 @@ class pkgCache::VerIterator : public Iterator { // Accessors inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;} inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;} +#if APT_PKG_ABI >= 413 /** \brief source package name this version comes from Always contains the name, even if it is the same as the binary name */ inline const char *SourcePkgName() const {return Owner->StrP + S->SourcePkgName;} /** \brief source version this version comes from Always contains the version string, even if it is the same as the binary version */ inline const char *SourceVerStr() const {return Owner->StrP + S->SourceVerStr;} +#endif inline const char *Arch() const { if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All) return "all";