]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debmetaindex.cc
fix test/integration/test-apt-ftparchive-cachedb-lp1274466 in travis
[apt.git] / apt-pkg / deb / debmetaindex.cc
index 345b1ec118cbec2ab8c4d632546f5da84d3dfc5b..6fd12add8f3589cf02fdb1fd84b596e70f7986b4 100644 (file)
@@ -9,8 +9,15 @@
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/indexrecords.h>
 #include <apt-pkg/sourcelist.h>
-#include <apt-pkg/error.h>
-
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/metaindex.h>
+
+#include <string.h>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
 #include <set>
 #include <algorithm>
 
@@ -35,7 +42,6 @@ string debReleaseIndex::Info(const char *Type, string const &Section, string con
    return Info;
 }
 
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
 string debReleaseIndex::MetaIndexInfo(const char *Type) const
 {
    string Info = ::URI::SiteOnly(URI) + ' ';
@@ -71,6 +77,21 @@ string debReleaseIndex::MetaIndexURI(const char *Type) const
    Res += Type;
    return Res;
 }
+
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+std::string debReleaseIndex::LocalFileName() const
+{
+   // see if we have a InRelease file
+   std::string PathInRelease =  MetaIndexFile("InRelease");
+   if (FileExists(PathInRelease))
+      return PathInRelease;
+
+   // and if not return the normal one
+   if (FileExists(PathInRelease))
+      return MetaIndexFile("Release");
+
+   return "";
+}
 #endif
 
 string debReleaseIndex::IndexURISuffix(const char *Type, string const &Section, string const &Arch) const