summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-08-12 23:44:33 +0200
committerJulian Andres Klode <jak@debian.org>2015-08-12 23:45:17 +0200
commita1dfe33790edda246a23a5c5d3c432cd8429e848 (patch)
tree2dcfd294b18bb828fbf085ec254179603e19dfb5 /apt-pkg/cacheiterators.h
parent85b9b32933eaeda6119d7a0224b5070ab8230c6b (diff)
Drop the Section field from pkgCache::Package again
This somehow got back, we don't really know why. Emulate the Section() method in the PkgIterator by looking at the section of the head of the VersionList.
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index f8321079a..48547e564 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -157,11 +157,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
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 inline const char *Section() const {
- APT_IGNORE_DEPRECATED_PUSH
- return S->Section == 0?0:Owner->StrP + S->Section;
- APT_IGNORE_DEPRECATED_POP
- }
+ APT_DEPRECATED 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;}
@@ -518,5 +514,7 @@ 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 inline const char * pkgCache::PkgIterator::Section() const
+ {return S->VersionList == 0 ? 0 : VersionList().Section();}
/*}}}*/
#endif