From a473295d01ed9c599926d9a8c212d4e1a404f78b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Nov 2016 22:40:20 -0800 Subject: Store tags in the cache (they are very useful :/). --- apt-pkg/pkgcachegen.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'apt-pkg/pkgcachegen.cc') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 107f1f141..8a8c88422 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1271,6 +1271,36 @@ bool pkgCacheGenerator::SelectReleaseFile(const string &File,const string &Site, Cache.HeaderP->RlsFileList = CurrentRlsFile - Cache.RlsFileP; Cache.HeaderP->ReleaseFileCount++; + return true; +} + /*}}}*/ +// ListParser::NewTag - Create a Tag element /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool pkgCacheListParser::NewTag(pkgCache::VerIterator &Ver, + const char *NameStart, + unsigned int NameSize) +{ + return Owner->NewTag(Ver, NameStart, NameSize); +} +bool pkgCacheGenerator::NewTag(pkgCache::VerIterator &Ver, + const char *NameStart, + unsigned int NameSize) +{ + // Get a structure + unsigned long Tagg = AllocateInMap(sizeof(pkgCache::Tag)); + if (Tagg == 0) + return false; + Cache.HeaderP->TagCount++; + + // Fill it in + pkgCache::TagIterator Tg(Cache,Cache.TagP + Tagg); + Tg->Name = WriteStringInMap(NameStart,NameSize); + if (Tg->Name == 0) + return false; + Tg->NextTag = Ver->TagList; + Ver->TagList = Tg.Index(); + return true; } /*}}}*/ -- cgit v1.2.3 From 4e99adb0d3727c0ae41edc9b3f52448d0d5b7655 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Nov 2016 23:58:01 -0800 Subject: Avoid wedging the entire system if recoverable :/. --- apt-pkg/pkgcachegen.cc | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'apt-pkg/pkgcachegen.cc') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 8a8c88422..1bdd43bf8 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -249,8 +249,10 @@ bool pkgCacheGenerator::MergeList(ListParser &List, while (List.Step() == true) { string const PackageName = List.Package(); - if (PackageName.empty() == true) - return false; + if (PackageName.empty() == true) { + _error->Warning("Encountered a section with no Package: header"); + continue; + } Counter++; if (Counter % 100 == 0 && Progress != 0) @@ -264,24 +266,26 @@ bool pkgCacheGenerator::MergeList(ListParser &List, { // package descriptions if (MergeListGroup(List, PackageName) == false) - return false; + continue; continue; } // Get a pointer to the package structure pkgCache::PkgIterator Pkg; Dynamic DynPkg(Pkg); - if (NewPackage(Pkg, PackageName, Arch) == false) + if (NewPackage(Pkg, PackageName, Arch) == false) { // TRANSLATOR: The first placeholder is a package name, // the other two should be copied verbatim as they include debug info - return _error->Error(_("Error occurred while processing %s (%s%d)"), + _error->Warning(_("Error occurred while processing %s (%s%d)"), PackageName.c_str(), "NewPackage", 1); + continue; + } if (Version.empty() == true) { if (MergeListPackage(List, Pkg) == false) - return false; + continue; } else { @@ -336,7 +340,7 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator pkgCache::VerIterator Ver(Cache); Dynamic DynVer(Ver); if (List.UsePackage(Pkg, Ver) == false) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "UsePackage", 1); // Find the right version to write the description @@ -415,11 +419,11 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator if (Res == 0 && Ver.end() == false && Ver->Hash == Hash) { if (List.UsePackage(Pkg,Ver) == false) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "UsePackage", 2); if (NewFileVer(Ver,List) == false) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewFileVer", 1); // Read only a single record and return @@ -436,7 +440,7 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator // Add a new version map_pointer_t const verindex = NewVersion(Ver, Version, Pkg.Index(), Hash, *LastVer); if (unlikely(verindex == 0)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewVersion", 1); if (oldMap != Map.Data()) @@ -444,15 +448,15 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator *LastVer = verindex; if (unlikely(List.NewVersion(Ver) == false)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewVersion", 2); if (unlikely(List.UsePackage(Pkg,Ver) == false)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "UsePackage", 3); if (unlikely(NewFileVer(Ver,List) == false)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewFileVer", 2); pkgCache::GrpIterator Grp = Pkg.Group(); @@ -473,12 +477,12 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator Dynamic DynV(V); for (; V.end() != true; ++V) if (unlikely(AddImplicitDepends(V, Pkg) == false)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "AddImplicitDepends", 1); } } if (unlikely(AddImplicitDepends(Grp, Pkg, Ver) == false)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "AddImplicitDepends", 2); // Read only a single record and return @@ -522,7 +526,7 @@ bool pkgCacheGenerator::AddNewDescription(ListParser &List, pkgCache::VerIterato map_pointer_t const descindex = NewDescription(Desc, lang, CurMd5, md5idx); if (unlikely(descindex == 0)) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Ver.ParentPkg().Name(), "NewDescription", 1); md5idx = Desc->md5sum; @@ -536,7 +540,7 @@ bool pkgCacheGenerator::AddNewDescription(ListParser &List, pkgCache::VerIterato *LastNextDesc = descindex; if (NewFileDesc(Desc,List) == false) - return _error->Error(_("Error occurred while processing %s (%s%d)"), + return _error->Warning(_("Error occurred while processing %s (%s%d)"), Ver.ParentPkg().Name(), "NewFileDesc", 1); return true; @@ -1589,7 +1593,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, } if ((*i)->Merge(Gen, Progress) == false) - return false; + continue; std::vector *Indexes = (*i)->GetIndexFiles(); if (Indexes != NULL) -- cgit v1.2.3 From d52f68c8d7e385613076d9ef56af179532139ac8 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 30 Dec 2016 14:08:16 -0800 Subject: It is just so absolutely critical that this works. --- apt-pkg/pkgcachegen.cc | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'apt-pkg/pkgcachegen.cc') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 1bdd43bf8..51bb9ec7b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1550,16 +1550,14 @@ static map_filesize_t ComputeSize(pkgSourceList const * const List, FileIterator } /*}}}*/ // BuildCache - Merge the list of index files into the cache /*{{{*/ -static bool BuildCache(pkgCacheGenerator &Gen, +static void BuildCache(pkgCacheGenerator &Gen, OpProgress * const Progress, map_filesize_t &CurrentSize,map_filesize_t TotalSize, pkgSourceList const * const List, FileIterator const Start, FileIterator const End) { - bool mergeFailure = false; - auto const indexFileMerge = [&](pkgIndexFile * const I) { - if (I->HasPackages() == false || mergeFailure) + if (I->HasPackages() == false) return; if (I->Exists() == false) @@ -1578,7 +1576,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, CurrentSize += Size; if (I->Merge(Gen,Progress) == false) - mergeFailure = true; + return; }; if (List != NULL) @@ -1598,8 +1596,6 @@ static bool BuildCache(pkgCacheGenerator &Gen, std::vector *Indexes = (*i)->GetIndexFiles(); if (Indexes != NULL) std::for_each(Indexes->begin(), Indexes->end(), indexFileMerge); - if (mergeFailure) - return false; } } @@ -1607,10 +1603,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, { Gen.SelectReleaseFile("", ""); std::for_each(Start, End, indexFileMerge); - if (mergeFailure) - return false; } - return true; } /*}}}*/ // CacheGenerator::MakeStatusCache - Construct the status cache /*{{{*/ @@ -1784,9 +1777,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress return false; TotalSize += ComputeSize(&List, Files.begin(),Files.end()); - if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, &List, - Files.end(),Files.end()) == false) - return false; + BuildCache(*Gen, Progress, CurrentSize, TotalSize, &List, + Files.end(),Files.end()); if (Writeable == true && SrcCacheFile.empty() == false) if (writeBackMMapToFile(Gen.get(), Map.get(), SrcCacheFile) == false) @@ -1797,9 +1789,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress { if (Debug == true) std::clog << "Building status cache in pkgcache.bin now" << std::endl; - if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL, - Files.begin(), Files.end()) == false) - return false; + BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL, + Files.begin(), Files.end()); if (Writeable == true && CacheFile.empty() == false) if (writeBackMMapToFile(Gen.get(), Map.get(), CacheFile) == false) @@ -1820,9 +1811,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress } Files = List.GetVolatileFiles(); - if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL, - Files.begin(), Files.end()) == false) - return false; + BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL, + Files.begin(), Files.end()); } if (OutMap != nullptr) @@ -1861,9 +1851,8 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O pkgCacheGenerator Gen(Map.get(),Progress); if (Gen.Start() == false || _error->PendingError() == true) return false; - if (BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL, - Files.begin(), Files.end()) == false) - return false; + BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL, + Files.begin(), Files.end()); if (_error->PendingError() == true) return false; -- cgit v1.2.3 From baec76f5f0f9fcbd71f6e2afaa7fc85543bd624c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 29 Jan 2017 15:01:00 -0800 Subject: The entire concept of PendingError() is flawed :/. --- apt-pkg/pkgcachegen.cc | 54 +++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'apt-pkg/pkgcachegen.cc') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 51bb9ec7b..8ee682db8 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -70,7 +70,7 @@ bool pkgCacheGenerator::Start() bool const newError = _error->PendingError(); _error->MergeWithStack(); if (newError) - return false; + return _error->ReturnError(); if (Map.Size() <= 0) return false; @@ -134,7 +134,7 @@ bool pkgCacheGenerator::Start() advoid a problem during a crash */ pkgCacheGenerator::~pkgCacheGenerator() { - if (_error->PendingError() == true || Map.validData() == false) + if (Map.validData() == false) return; if (Map.Sync() == false) return; @@ -249,10 +249,8 @@ bool pkgCacheGenerator::MergeList(ListParser &List, while (List.Step() == true) { string const PackageName = List.Package(); - if (PackageName.empty() == true) { - _error->Warning("Encountered a section with no Package: header"); + if (PackageName.empty() == true) continue; - } Counter++; if (Counter % 100 == 0 && Progress != 0) @@ -276,7 +274,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, if (NewPackage(Pkg, PackageName, Arch) == false) { // TRANSLATOR: The first placeholder is a package name, // the other two should be copied verbatim as they include debug info - _error->Warning(_("Error occurred while processing %s (%s%d)"), + _error->Error(_("Error occurred while processing %s (%s%d)"), PackageName.c_str(), "NewPackage", 1); continue; } @@ -340,7 +338,7 @@ bool pkgCacheGenerator::MergeListPackage(ListParser &List, pkgCache::PkgIterator pkgCache::VerIterator Ver(Cache); Dynamic DynVer(Ver); if (List.UsePackage(Pkg, Ver) == false) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "UsePackage", 1); // Find the right version to write the description @@ -419,11 +417,11 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator if (Res == 0 && Ver.end() == false && Ver->Hash == Hash) { if (List.UsePackage(Pkg,Ver) == false) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "UsePackage", 2); if (NewFileVer(Ver,List) == false) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewFileVer", 1); // Read only a single record and return @@ -440,7 +438,7 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator // Add a new version map_pointer_t const verindex = NewVersion(Ver, Version, Pkg.Index(), Hash, *LastVer); if (unlikely(verindex == 0)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewVersion", 1); if (oldMap != Map.Data()) @@ -448,15 +446,15 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator *LastVer = verindex; if (unlikely(List.NewVersion(Ver) == false)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewVersion", 2); if (unlikely(List.UsePackage(Pkg,Ver) == false)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "UsePackage", 3); if (unlikely(NewFileVer(Ver,List) == false)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "NewFileVer", 2); pkgCache::GrpIterator Grp = Pkg.Group(); @@ -477,12 +475,12 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator Dynamic DynV(V); for (; V.end() != true; ++V) if (unlikely(AddImplicitDepends(V, Pkg) == false)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "AddImplicitDepends", 1); } } if (unlikely(AddImplicitDepends(Grp, Pkg, Ver) == false)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "AddImplicitDepends", 2); // Read only a single record and return @@ -526,7 +524,7 @@ bool pkgCacheGenerator::AddNewDescription(ListParser &List, pkgCache::VerIterato map_pointer_t const descindex = NewDescription(Desc, lang, CurMd5, md5idx); if (unlikely(descindex == 0)) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Ver.ParentPkg().Name(), "NewDescription", 1); md5idx = Desc->md5sum; @@ -540,7 +538,7 @@ bool pkgCacheGenerator::AddNewDescription(ListParser &List, pkgCache::VerIterato *LastNextDesc = descindex; if (NewFileDesc(Desc,List) == false) - return _error->Warning(_("Error occurred while processing %s (%s%d)"), + return _error->Error(_("Error occurred while processing %s (%s%d)"), Ver.ParentPkg().Name(), "NewFileDesc", 1); return true; @@ -1432,7 +1430,7 @@ static bool CheckValidity(const string &CacheFile, { if (Debug == true) std::clog << "Errors are pending or Map is empty() for " << CacheFile << std::endl; - return false; + return _error->ReturnError(); } std::unique_ptr RlsVisited(new bool[Cache.HeaderP->ReleaseFileCount]); @@ -1512,7 +1510,7 @@ static bool CheckValidity(const string &CacheFile, std::clog << "Validity failed because of pending errors:" << std::endl; _error->DumpErrors(std::clog, GlobalError::DEBUG, false); } - return false; + return _error->ReturnError(); } if (OutMap != 0) @@ -1575,8 +1573,10 @@ static void BuildCache(pkgCacheGenerator &Gen, Progress->OverallProgress(CurrentSize, TotalSize, Size, _("Reading package lists")); CurrentSize += Size; - if (I->Merge(Gen,Progress) == false) + if (I->Merge(Gen,Progress) == false) { + _error->ReturnError(); return; + } }; if (List != NULL) @@ -1590,8 +1590,10 @@ static void BuildCache(pkgCacheGenerator &Gen, continue; } - if ((*i)->Merge(Gen, Progress) == false) + if ((*i)->Merge(Gen, Progress) == false) { + _error->ReturnError(); continue; + } std::vector *Indexes = (*i)->GetIndexFiles(); if (Indexes != NULL) @@ -1663,7 +1665,7 @@ static bool loadBackMMapFromFile(std::unique_ptr &Gen, bool const newError = _error->PendingError(); _error->MergeWithStack(); if (alloc == 0 && newError) - return false; + return _error->ReturnError(); if (CacheF.Read((unsigned char *)Map->Data() + alloc, CacheF.Size()) == false) return false; Gen.reset(new pkgCacheGenerator(Map.get(),Progress)); @@ -1849,13 +1851,15 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O if (Progress != NULL) Progress->OverallProgress(0,1,1,_("Reading package lists")); pkgCacheGenerator Gen(Map.get(),Progress); - if (Gen.Start() == false || _error->PendingError() == true) + if (Gen.Start() == false) return false; + if (_error->PendingError() == true) + return _error->ReturnError(); BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL, Files.begin(), Files.end()); + // We've passed the point of no return + _error->ReturnError(); - if (_error->PendingError() == true) - return false; *OutMap = Map.release(); return true; -- cgit v1.2.3 From c2fb49ca1783b9ea2dd8b7cb90a2284750076c65 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 31 Jan 2017 05:53:50 -0800 Subject: Port TagIterator to correctly support ReMap (doh). --- apt-pkg/pkgcachegen.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'apt-pkg/pkgcachegen.cc') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 8ee682db8..7152f04e2 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -175,6 +175,10 @@ void pkgCacheGenerator::ReMap(void const * const oldMap, void const * const newM i != Dynamic::toReMap.end(); ++i) if (std::get<1>(seen.insert(*i)) == true) (*i)->ReMap(oldMap, newMap); + for (std::vector::const_iterator i = Dynamic::toReMap.begin(); + i != Dynamic::toReMap.end(); ++i) + if (std::get<1>(seen.insert(*i)) == true) + (*i)->ReMap(oldMap, newMap); for (std::vector::const_iterator i = Dynamic::toReMap.begin(); i != Dynamic::toReMap.end(); ++i) if (std::get<1>(seen.insert(*i)) == true) @@ -1290,18 +1294,20 @@ bool pkgCacheGenerator::NewTag(pkgCache::VerIterator &Ver, unsigned int NameSize) { // Get a structure - unsigned long Tagg = AllocateInMap(sizeof(pkgCache::Tag)); - if (Tagg == 0) + map_pointer_t const idxTag = AllocateInMap(sizeof(pkgCache::Tag)); + if (unlikely(idxTag == 0)) return false; - Cache.HeaderP->TagCount++; // Fill it in - pkgCache::TagIterator Tg(Cache,Cache.TagP + Tagg); - Tg->Name = WriteStringInMap(NameStart,NameSize); - if (Tg->Name == 0) + pkgCache::TagIterator Tg(Cache,Cache.TagP + idxTag); + map_pointer_t const idxName = WriteStringInMap(NameStart,NameSize); + if (idxName == 0) return false; + Tg->Name = idxName; + Tg->NextTag = Ver->TagList; Ver->TagList = Tg.Index(); + Cache.HeaderP->TagCount++; return true; } -- cgit v1.2.3 From 35d8bb14e1102f0231432c7ad33be414e07a15e6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 1 Feb 2017 07:28:12 -0800 Subject: Tags should use StoreString, not WriteStringInMap. --- apt-pkg/pkgcachegen.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/pkgcachegen.cc') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 7152f04e2..1b4c89f84 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1300,7 +1300,7 @@ bool pkgCacheGenerator::NewTag(pkgCache::VerIterator &Ver, // Fill it in pkgCache::TagIterator Tg(Cache,Cache.TagP + idxTag); - map_pointer_t const idxName = WriteStringInMap(NameStart,NameSize); + map_pointer_t const idxName = StoreString(TAG,NameStart,NameSize); if (idxName == 0) return false; Tg->Name = idxName; @@ -1379,6 +1379,7 @@ map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, cons case PKGNAME: strings = &strPkgNames; break; case VERSIONNUMBER: strings = &strVersions; break; case SECTION: strings = &strSections; break; + case TAG: strings = &strTags; break; default: _error->Fatal("Unknown enum type used for string storage of '%.*s'", Size, S); return 0; } -- cgit v1.2.3