diff options
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 0fc08d8fb..878170d00 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -244,6 +244,8 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) if (ParseProvides(Ver) == false) return false; + if (ParseTag(Ver) == false) + return false; return true; } @@ -953,6 +955,46 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) return true; } /*}}}*/ +// ListParser::ParseTag - Parse the tag list /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool debListParser::ParseTag(pkgCache::VerIterator &Ver) +{ + const char *Start; + const char *Stop; + if (Section.Find("Tag",Start,Stop) == false) + return true; + + while (1) { + while (1) { + if (Start == Stop) + return true; + if (Stop[-1] != ' ' && Stop[-1] != '\t') + break; + --Stop; + } + + const char *Begin = Stop - 1; + while (Begin != Start && Begin[-1] != ' ' && Begin[-1] != ',') + --Begin; + + if (NewTag(Ver, Begin, Stop - Begin) == false) + return false; + + while (1) { + if (Begin == Start) + return true; + if (Begin[-1] == ',') + break; + --Begin; + } + + Stop = Begin - 1; + } + + return true; +} + /*}}}*/ // ListParser::GrabWord - Matches a word and returns /*{{{*/ // --------------------------------------------------------------------- /* Looks for a word in a list of words - for ParseStatus */ |