]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debindexfile.cc
let the Mark methods return if their marking was successful
[apt.git] / apt-pkg / deb / debindexfile.cc
index af1209ccb9124bd0acda0b798553b6d093a3ac27..1e8c040333b028def25e8330b484ab4cb15ac035 100644 (file)
@@ -66,7 +66,10 @@ pkgSrcRecords::Parser *debSourcesIndex::CreateSrcParser() const
    string SourcesURI = _config->FindDir("Dir::State::lists") + 
       URItoFileName(IndexURI("Sources"));
    string SourcesURIgzip = SourcesURI + ".gz";
    string SourcesURI = _config->FindDir("Dir::State::lists") + 
       URItoFileName(IndexURI("Sources"));
    string SourcesURIgzip = SourcesURI + ".gz";
-   if (!FileExists(SourcesURI) && FileExists(SourcesURIgzip))
+
+   if (!FileExists(SourcesURI) && !FileExists(SourcesURIgzip))
+      return NULL;
+   else if (!FileExists(SourcesURI) && FileExists(SourcesURIgzip))
       SourcesURI = SourcesURIgzip;
 
    return new debSrcRecordParser(SourcesURI,this);
       SourcesURI = SourcesURIgzip;
 
    return new debSrcRecordParser(SourcesURI,this);
@@ -324,8 +327,14 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
       return _error->Error("Problem with MergeList %s",PackageFile.c_str());
 
    // Check the release file
       return _error->Error("Problem with MergeList %s",PackageFile.c_str());
 
    // Check the release file
-   string ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("Release");
+   string ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("InRelease");
+   bool releaseExists = false;
    if (FileExists(ReleaseFile) == true)
    if (FileExists(ReleaseFile) == true)
+      releaseExists = true;
+   else
+      ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("Release");
+
+   if (releaseExists == true || FileExists(ReleaseFile) == true)
    {
       FileFd Rel(ReleaseFile,FileFd::ReadOnly);
       if (_error->PendingError() == true)
    {
       FileFd Rel(ReleaseFile,FileFd::ReadOnly);
       if (_error->PendingError() == true)