diff options
-rw-r--r-- | apt-pkg/pkgcache.cc | 3 | ||||
-rw-r--r-- | apt-pkg/pkgcache.h | 10 | ||||
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 3 | ||||
-rw-r--r-- | debian/changelog | 3 |
4 files changed, 14 insertions, 5 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 1bbd74bd9..ba3c5cbf8 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -55,6 +55,7 @@ pkgCache::Header::Header() Dirty = false; HeaderSz = sizeof(pkgCache::Header); + GroupSz = sizeof(pkgCache::Group); PackageSz = sizeof(pkgCache::Package); PackageFileSz = sizeof(pkgCache::PackageFile); VersionSz = sizeof(pkgCache::Version); @@ -64,6 +65,7 @@ pkgCache::Header::Header() VerFileSz = sizeof(pkgCache::VerFile); DescFileSz = sizeof(pkgCache::DescFile); + GroupCount = 0; PackageCount = 0; VersionCount = 0; DescriptionCount = 0; @@ -90,6 +92,7 @@ pkgCache::Header::Header() bool pkgCache::Header::CheckSizes(Header &Against) const { if (HeaderSz == Against.HeaderSz && + GroupSz == Against.GroupSz && PackageSz == Against.PackageSz && PackageFileSz == Against.PackageFileSz && VersionSz == Against.VersionSz && diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index a2e63ff03..643f240b0 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -244,6 +244,7 @@ struct pkgCache::Header If any of the size values do not exactly match what the client expects then the client should refuse the load the file. */ unsigned short HeaderSz; + unsigned short GroupSz; unsigned short PackageSz; unsigned short PackageFileSz; unsigned short VersionSz; @@ -329,12 +330,15 @@ struct pkgCache::Group map_ptrloc Name; // StringItem // Linked List - /** Link to the first package which belongs to the group */ + /** \brief Link to the first package which belongs to the group */ map_ptrloc FirstPackage; // Package - /** Link to the last package which belongs to the group */ + /** \brief Link to the last package which belongs to the group */ map_ptrloc LastPackage; // Package - /** Link to the next Group */ + /** \brief Link to the next Group */ map_ptrloc Next; // Group + /** \brief unique sequel ID */ + unsigned int ID; + }; /*}}}*/ // Package structure /*{{{*/ diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 114c9d5ed..d96d3370f 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -356,8 +356,7 @@ bool pkgCacheGenerator::NewGroup(pkgCache::GrpIterator &Grp, const string &Name) Grp->Next = Cache.HeaderP->GrpHashTable[Hash]; Cache.HeaderP->GrpHashTable[Hash] = Group; - Cache.HeaderP->GroupCount++; - + Grp->ID = Cache.HeaderP->GroupCount++; return true; } /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 76fc2550b..5885f9246 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,6 +43,9 @@ apt (0.7.26~exp4) experimental; urgency=low use, extended_states and uri schemes. * doc/cache.sgml: - drop the file in favor of inplace documentation with doxygen + * apt-pkg/pkgcache.h: + - enhance the Groups ABI by providing a ID as the other structs does + - check also the size of the Group struct then checking for the others [ Jari Aalto ] * cmdline/apt-get.cc: |