summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:58:39 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:58:39 +0000
commit9e10ad8a863f756436fc19d3370822b3619d9c05 (patch)
tree4d326b82cede35a3b8c769a664ed8d0fe6b4a872
parent4520bfdf366b2729903b02ecd4f8d6788bffc9c1 (diff)
fix build-dependency parser to understand [!arch] flags...
Author: tausq Date: 2001-10-02 03:03:47 GMT fix build-dependency parser to understand [!arch] flags (Closes: #88798)
-rw-r--r--apt-pkg/deb/deblistparser.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 269b474b7..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.27 2001/07/26 06:15:59 jgg Exp $
+// $Id: deblistparser.cc,v 1.28 2001/10/02 03:03:47 tausq Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
@@ -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,7 +411,13 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
if (End == Stop)
return 0;
-
+
+ if (*I == '!')
+ {
+ NegArch = true;
+ I++;
+ }
+
if (stringcmp(arch,I,End) == 0)
Found = true;
@@ -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 */
}