// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: deblistparser.cc,v 1.20 1999/06/04 05:54:20 jgg Exp $
+// $Id: deblistparser.cc,v 1.23 1999/09/30 06:30:34 jgg Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
/* */
debListParser::debListParser(FileFd &File) : Tags(File)
{
+ Arch = _config->Find("APT::architecture");
}
/*}}}*/
// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
{"extra",pkgCache::State::Extra}};
if (GrabWord(string(Start,Stop-Start),PrioList,
_count(PrioList),Ver->Priority) == false)
- return _error->Error("Malformed Priority line");
+ Ver->Priority = pkgCache::State::Extra;
}
if (ParseDepends(Ver,"Depends",pkgCache::Dep::Depends) == false)
continue;
/* Strip out any spaces from the text, this undoes dpkgs reformatting
- of certain fields */
+ of certain fields. dpkg also has the rather interesting notion of
+ reformatting depends operators < -> <= */
char *I = S;
for (; Start != End; Start++)
+ {
if (isspace(*Start) == 0)
- *I++ = *Start;
+ *I++ = tolower(*Start);
+ if (*Start == '<' && Start[1] != '<' && Start[1] != '=')
+ *I++ = '=';
+ if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
+ *I++ = '=';
+ }
Result = AddCRC16(Result,S,I - S);
}
Status: want flag status
want = unknown, install, hold, deinstall, purge
flag = ok, reinstreq, hold, hold-reinstreq
- status = not-installed, unpacked, half-configured, uninstalled,
+ status = not-installed, unpacked, half-configured,
half-installed, config-files, post-inst-failed,
removal-failed, installed
{"unpacked",pkgCache::State::UnPacked},
{"half-configured",pkgCache::State::HalfConfigured},
{"installed",pkgCache::State::Installed},
- {"uninstalled",pkgCache::State::UnInstalled},
{"half-installed",pkgCache::State::HalfInstalled},
{"config-files",pkgCache::State::ConfigFiles},
{"post-inst-failed",pkgCache::State::HalfConfigured},
bool debListParser::Step()
{
iOffset = Tags.Offset();
- string Arch = _config->Find("APT::architecture");
while (Tags.Step(Section) == true)
- {
- /* See if this is the correct Architecture, if it isnt then we
- drop the whole section */
+ {
+ /* 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)