summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/pkgcache.cc3
-rw-r--r--apt-pkg/pkgcache.h10
-rw-r--r--apt-pkg/pkgcachegen.cc3
3 files changed, 11 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;
}
/*}}}*/