summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-11-07 19:18:21 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-11-08 14:29:25 +0100
commit32ab4bd05cb298f6bf1f9574f5b20570beaae429 (patch)
treed35f6a68c354c955a8407c1b4004570b14a8a815 /apt-pkg/pkgcachegen.cc
parentfa5404ab01bdf06eaf147d9f133139e6c89b906a (diff)
guard pkg/grp hashtable creation changes
The change itself is no problem ABI wise, but the remove of the old undynamic hashtables is, so we bring it back for older abis and happily use the now available free space to backport more recent additions like the dynamic hashtable itself. Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index a2c1c8760..ba454f057 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -74,7 +74,7 @@ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) :
*Cache.HeaderP = pkgCache::Header();
// make room for the hashtables for packages and groups
- if (Map.RawAllocate(2 * (Cache.HeaderP->HashTableSize * sizeof(map_pointer_t))) == 0)
+ if (Map.RawAllocate(2 * (Cache.HeaderP->GetHashTableSize() * sizeof(map_pointer_t))) == 0)
return;
map_stringitem_t const idxVerSysName = WriteStringInMap(_system->VS->Label);
@@ -96,10 +96,10 @@ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) :
map_stringitem_t const idxArchitectures = WriteStringInMap(list);
if (unlikely(idxArchitectures == 0))
return;
- Cache.HeaderP->Architectures = idxArchitectures;
+ Cache.HeaderP->SetArchitectures(idxArchitectures);
}
else
- Cache.HeaderP->Architectures = idxArchitecture;
+ Cache.HeaderP->SetArchitectures(idxArchitecture);
Cache.ReMap();
}
@@ -616,7 +616,7 @@ bool pkgCacheGenerator::NewGroup(pkgCache::GrpIterator &Grp, const string &Name)
// Insert it into the hash table
unsigned long const Hash = Cache.Hash(Name);
- map_pointer_t *insertAt = &Cache.HeaderP->GrpHashTable()[Hash];
+ map_pointer_t *insertAt = &Cache.HeaderP->GrpHashTableP()[Hash];
while (*insertAt != 0 && strcasecmp(Name.c_str(), Cache.StrP + (Cache.GrpP + *insertAt)->Name) > 0)
insertAt = &(Cache.GrpP + *insertAt)->Next;
Grp->Next = *insertAt;
@@ -652,18 +652,18 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name
Grp->FirstPackage = Package;
// Insert it into the hash table
map_id_t const Hash = Cache.Hash(Name);
- map_pointer_t *insertAt = &Cache.HeaderP->PkgHashTable()[Hash];
+ map_pointer_t *insertAt = &Cache.HeaderP->PkgHashTableP()[Hash];
while (*insertAt != 0 && strcasecmp(Name.c_str(), Cache.StrP + (Cache.GrpP + (Cache.PkgP + *insertAt)->Group)->Name) > 0)
- insertAt = &(Cache.PkgP + *insertAt)->Next;
- Pkg->Next = *insertAt;
+ insertAt = &(Cache.PkgP + *insertAt)->NextPackage;
+ Pkg->NextPackage = *insertAt;
*insertAt = Package;
}
else // Group the Packages together
{
// this package is the new last package
pkgCache::PkgIterator LastPkg(Cache, Cache.PkgP + Grp->LastPackage);
- Pkg->Next = LastPkg->Next;
- LastPkg->Next = Package;
+ Pkg->NextPackage = LastPkg->NextPackage;
+ LastPkg->NextPackage = Package;
}
Grp->LastPackage = Package;