#include <apt-pkg/strutl.h>
#include <apt-pkg/crc-16.h>
#include <apt-pkg/md5.h>
+#include <apt-pkg/macros.h>
#include <ctype.h>
-
-#include <system.h>
/*}}}*/
static debListParser::WordList PrioList[] = {{"important",pkgCache::State::Important},
// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
// ---------------------------------------------------------------------
/* */
+unsigned long debListParser::FindTagWrite(const char *Tag)
+{
+ const char *Start;
+ const char *Stop;
+ if (Section.Find(Tag,Start,Stop) == false)
+ return 0;
+ return WriteString(Start,Stop - Start);
+}
+ /*}}}*/
+// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
+// ---------------------------------------------------------------------
+/* */
unsigned long debListParser::UniqFindTagWrite(const char *Tag)
{
const char *Start;
/* */
bool debListParser::NewVersion(pkgCache::VerIterator Ver)
{
- Ver->Display = UniqFindTagWrite("Name");
+ Ver->Display = FindTagWrite("Name");
if (Ver->Display == 0)
- Ver->Display = UniqFindTagWrite("Maemo-Display-Name");
+ Ver->Display = FindTagWrite("Maemo-Display-Name");
// Parse the section
Ver->Section = UniqFindTagWrite("Section");
return false;
if (ParseDepends(Ver,"Replaces",pkgCache::Dep::Replaces) == false)
return false;
+ if (ParseDepends(Ver,"Enhances",pkgCache::Dep::Enhances) == false)
+ return false;
// Obsolete.
if (ParseDepends(Ver,"Optional",pkgCache::Dep::Suggests) == false)
pkgCache::VerIterator Ver)
{
if (Pkg->Display == 0)
- Pkg->Display = UniqFindTagWrite("Name");
+ Pkg->Display = FindTagWrite("Name");
if (Pkg->Display == 0)
- Pkg->Display = UniqFindTagWrite("Maemo-Display-Name");
+ Pkg->Display = FindTagWrite("Maemo-Display-Name");
if (Pkg->Section == 0)
Pkg->Section = UniqFindTagWrite("Section");
if (Section.FindFlag("Essential",Pkg->Flags,pkgCache::Flag::Essential) == false)
for (; Start != End; Start++)
{
if (isspace(*Start) == 0)
- *I++ = tolower(*Start);
+ *I++ = tolower_ascii(*Start);
if (*Start == '<' && Start[1] != '<' && Start[1] != '=')
*I++ = '=';
if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
iOffset = Tags.Offset();
while (Tags.Step(Section) == true)
{
+ const char *Start;
+ const char *Stop;
+
+ if (Section.Find("Package",Start,Stop) == false) {
+ _error->Warning("Encountered a section with no Package: header");
+ continue;
+ }
+
/* See if this is the correct Architecture, if it isn't then we
drop the whole section. A missing arch tag only happens (in theory)
inside the Status file, so that is a positive return */
- const char *Start;
- const char *Stop;
+
if (Section.Find("Architecture",Start,Stop) == false)
return true;