// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: deblistparser.cc,v 1.24 2001/02/20 07:03:17 jgg Exp $
+// $Id: deblistparser.cc,v 1.28 2001/10/02 03:03:47 tausq Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
#include <apt-pkg/strutl.h>
#include <apt-pkg/crc-16.h>
+#include <ctype.h>
+
#include <system.h>
/*}}}*/
"Conflicts",
"Replaces",0};
unsigned long Result = INIT_FCS;
- char S[300];
+ char S[1024];
for (const char **I = Sections; *I != 0; I++)
{
const char *Start;
if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
*I++ = '=';
}
-
+
Result = AddCRC16(Result,S,I - S);
}
if (ParseArchFlags == true)
{
string arch = _config->Find("APT::Architecture");
-
+
// Parse an architecture
if (I != Stop && *I == '[')
{
const char *End = I;
bool Found = false;
+ bool NegArch = false;
while (I != Stop)
{
// look for whitespace or ending ']'
if (End == Stop)
return 0;
-
- if (stringcmp(I,End,arch.begin(),arch.end()) == 0)
+
+ if (*I == '!')
+ {
+ NegArch = true;
+ I++;
+ }
+
+ if (stringcmp(arch,I,End) == 0)
Found = true;
if (*End++ == ']') {
I = End;
for (;I != Stop && isspace(*I) != 0; I++);
}
+
+ if (NegArch)
+ Found = !Found;
- if (Found == false)
+ if (Found == false)
Package = ""; /* not for this arch */
}
if (Section.Find("Architecture",Start,Stop) == false)
return true;
- if (stringcmp(Start,Stop,Arch.begin(),Arch.end()) == 0)
+ if (stringcmp(Arch,Start,Stop) == 0)
return true;
if (stringcmp(Start,Stop,"all") == 0)