- regex_t Pattern;
- int Res;
-
- // build regexp for the task
- char S[300];
- snprintf(S, sizeof(S), "^Task:.*[^a-z]%s[^a-z].*\n", *I);
- regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE);
-
- for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
- {
- pkgCache::VerIterator ver = (*Cache)[Pkg].CandidateVerIter(*Cache);
- if(ver.end())
- continue;
- pkgRecords::Parser &parser = Recs.Lookup(ver.FileList());
- parser.GetRec(start,end);
- strncpy(buf, start, end-start);
- buf[end-start] = 0x0;
- if (regexec(&Pattern,buf,0,0,0) != 0)
- continue;
- TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst);
- }
+ pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache);
+ if(ver.end())
+ continue;
+ pkgRecords::Parser &parser = Recs.Lookup(ver.FileList());
+ parser.GetRec(start,end);
+ strncpy(buf, start, end-start);
+ buf[end-start] = 0x0;
+ if (regexec(&Pattern,buf,0,0,0) != 0)
+ continue;
+ res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst);
+ found = true;