+
+ // find release
+ const pkgIndexFile& SI = Parse->Index();
+ pkgSourceList *SrcList = CacheFile.GetSourceList();
+ for (pkgSourceList::const_iterator S = SrcList->begin();
+ S != SrcList->end(); ++S)
+ {
+ vector<pkgIndexFile *> *Indexes = (*S)->GetIndexFiles();
+ for (vector<pkgIndexFile *>::const_iterator IF = Indexes->begin();
+ IF != Indexes->end(); ++IF)
+ {
+ if (&SI == (*IF))
+ {
+ std::string dirname = _config->FindDir("Dir::State::lists");
+ std::string path = dirname + URItoFileName((*S)->GetURI()) + "dists_" + (*S)->GetDist() + "_Release";
+ indexRecords records;
+ records.Load(path);
+ if (records.GetSuite() == DefRel)
+ {
+ ioprintf(clog, "Selectied version '%s' (%s) for %s\n",
+ Ver.c_str(), DefRel.c_str(), Src.c_str());
+ Last = Parse;
+ Offset = Parse->Offset();
+ Version = Ver;
+ FoundRel = DefRel;
+ break;
+ }
+ }
+ }
+ }
+ if (DefRel.empty() == false && (DefRel == FoundRel))
+ break;
+