debReleaseIndex *r = (debReleaseIndex*)metaindex;
// see if we have a InRelease file
- std::string PathInRelease = _config->FindDir("Dir::State::lists") +
- URItoFileName(r->MetaIndexURI("InRelease"));
+ std::string PathInRelease = r->MetaIndexFile("InRelease");
if (FileExists(PathInRelease))
return PathInRelease;
// and if not return the normal one
- return _config->FindDir("Dir::State::lists") +
- URItoFileName(r->MetaIndexURI("Release"));
+ return r->MetaIndexFile("Release");
}
std::string GetReleaseForSourceRecord(pkgSourceList *SrcList,
pkgSrcRecords::Parser *Last = 0;
unsigned long Offset = 0;
string Version;
- string FoundRel;
pkgSourceList *SrcList = CacheFile.GetSourceList();
/* Iterate over all of the hits, which includes the resulting
while ((Parse = SrcRecs.Find(Src.c_str(), MatchSrcOnly)) != 0)
{
const string Ver = Parse->Version();
- const string Rel = GetReleaseForSourceRecord(SrcList, Parse);
- if (RelTag != "" && Rel == RelTag)
+ // See if we need to look for a specific release tag
+ if (RelTag != "")
{
- ioprintf(c1out, "Selectied version '%s' (%s) for %s\n",
- Ver.c_str(), RelTag.c_str(), Src.c_str());
- Last = Parse;
- Offset = Parse->Offset();
- Version = Ver;
- FoundRel = RelTag;
- break;
- }
+ const string Rel = GetReleaseForSourceRecord(SrcList, Parse);
- if (RelTag.empty() == false && (RelTag == FoundRel))
- break;
+ if (Rel == RelTag)
+ {
+ ioprintf(c1out, "Selectied version '%s' (%s) for %s\n",
+ Ver.c_str(), RelTag.c_str(), Src.c_str());
+ Last = Parse;
+ Offset = Parse->Offset();
+ break;
+ }
+ }
// Ignore all versions which doesn't fit
if (VerTag.empty() == false &&
Version = Ver;
}
- // was the version check above an exact match? If so, we don't need to look further
+ // was the version check above an exact match?
+ // If so, we don't need to look further
if (VerTag.empty() == false && (VerTag == Ver))
- {
break;
- }
}
if (Last != 0 || VerTag.empty() == true)
break;
+ _error->Error(_("Ignore unavailable version '%s' of package '%s'"), VerTag.c_str(), TmpSrc.c_str());
return 0;
}