summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-11-29 22:40:20 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2016-11-29 22:40:20 -0800
commita473295d01ed9c599926d9a8c212d4e1a404f78b (patch)
tree28a803fe5a4518bbb9a8a52fdd1a3e4cccf7fd47 /apt-pkg/pkgcachegen.cc
parent46ea89bf9aa2c814e803795cb29338d524389d4e (diff)
Store tags in the cache (they are very useful :/).
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc30
1 files changed, 30 insertions, 0 deletions
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
@@ -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