X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e7b470eefa0499d0edbdda4f466eb77b17c2067b..d993b35da2160e36a723bfafb6aa266000199a69:/apt-pkg/deb/deblistparser.cc diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 267636776..64a2bad91 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: deblistparser.cc,v 1.25 2001/05/27 05:36:04 jgg Exp $ +// $Id: deblistparser.cc,v 1.28 2001/10/02 03:03:47 tausq Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -152,7 +152,7 @@ unsigned short debListParser::VersionHash() "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; @@ -173,7 +173,7 @@ unsigned short debListParser::VersionHash() if (*Start == '>' && Start[1] != '>' && Start[1] != '=') *I++ = '='; } - + Result = AddCRC16(Result,S,I - S); } @@ -391,7 +391,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, if (ParseArchFlags == true) { string arch = _config->Find("APT::Architecture"); - + // Parse an architecture if (I != Stop && *I == '[') { @@ -402,6 +402,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, const char *End = I; bool Found = false; + bool NegArch = false; while (I != Stop) { // look for whitespace or ending ']' @@ -410,8 +411,14 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, if (End == Stop) return 0; - - if (stringcmp(arch.c_str(),arch.c_str()+arch.length(),I,End) == 0) + + if (*I == '!') + { + NegArch = true; + I++; + } + + if (stringcmp(arch,I,End) == 0) Found = true; if (*End++ == ']') { @@ -422,8 +429,11 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, I = End; for (;I != Stop && isspace(*I) != 0; I++); } + + if (NegArch) + Found = !Found; - if (Found == false) + if (Found == false) Package = ""; /* not for this arch */ } @@ -538,7 +548,7 @@ bool debListParser::Step() if (Section.Find("Architecture",Start,Stop) == false) return true; - if (stringcmp(Arch.c_str(),Arch.c_str()+Arch.length(),Start,Stop) == 0) + if (stringcmp(Arch,Start,Stop) == 0) return true; if (stringcmp(Start,Stop,"all") == 0)