diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2016-11-29 22:40:20 -0800 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2020-07-17 00:22:23 -1000 |
commit | 1c17882edec3cd95aa6a33cf3219ddce5dca89db (patch) | |
tree | f62f21c047e657ae40b1542822f4ad28d6eea2e2 /apt-pkg/pkgcachegen.cc | |
parent | 00b67a48221b00966c56b96c59f38ec0b145aded (diff) |
Store tags in the cache (they are very useful :/).
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 5a3b65b3a..a508644fc 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1274,6 +1274,36 @@ bool pkgCacheGenerator::SelectReleaseFile(const string &File,const string &Site, 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; +} + /*}}}*/ // CacheGenerator::SelectFile - Select the current file being parsed /*{{{*/ // --------------------------------------------------------------------- /* This is used to select which file is to be associated with all newly |