From 9c14e3d619e713aefa623986b5bbae81a1d6cc94 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:43 +0000 Subject: Config class and source list Author: jgg Date: 1998-07-09 05:12:27 GMT Config class and source list --- apt-pkg/deb/deblistparser.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 5fbb43a9f..3c82ee51d 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.4 1998/07/07 04:17:16 jgg Exp $ +// $Id: deblistparser.cc,v 1.5 1998/07/09 05:12:37 jgg Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -12,6 +12,9 @@ // Include Files /*{{{*/ #include #include +#include +#include + #include /*}}}*/ @@ -82,13 +85,13 @@ bool debListParser::HandleFlag(const char *Tag,unsigned long &Flags, return true; int Set = 2; - if (strncasecmp(Start,"yes",Stop - Start) == 0) + if (stringcasecmp(Start,Stop,"yes") == 0) Set = 1; - if (strncasecmp(Start,"true",Stop - Start) == 0) + if (stringcasecmp(Start,Stop,"true") == 0) Set = 1; - if (strncasecmp(Start,"no",Stop - Start) == 0) + if (stringcasecmp(Start,Stop,"no") == 0) Set = 0; - if (strncasecmp(Start,"false",Stop - Start) == 0) + if (stringcasecmp(Start,Stop,"false") == 0) Set = 0; if (Set == 2) { @@ -489,6 +492,7 @@ bool debListParser::GrabWord(string Word,WordList *List,int Count, 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 @@ -497,13 +501,11 @@ bool debListParser::Step() const char *Stop; if (Section.Find("Architecture",Start,Stop) == false) return true; - - if (strncmp(Start,"i386",Stop - Start) == 0 && - strlen("i386") == (unsigned)(Stop - Start)) + + if (stringcmp(Start,Stop,Arch.begin(),Arch.end()) == 0) return true; - if (strncmp(Start,"all",Stop - Start) == 0 && - 3 == (unsigned)(Stop - Start)) + if (stringcmp(Start,Stop,"all") == 0) return true; iOffset = Tags.Offset(); -- cgit v1.2.3