summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debmetaindex.cc16
-rw-r--r--apt-pkg/deb/debmetaindex.h6
2 files changed, 21 insertions, 1 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 345b1ec11..504877558 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -35,7 +35,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 +70,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
diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h
index fc0b7f948..9f488898d 100644
--- a/apt-pkg/deb/debmetaindex.h
+++ b/apt-pkg/deb/debmetaindex.h
@@ -45,6 +45,12 @@ class debReleaseIndex : public metaIndex {
std::string MetaIndexInfo(const char *Type) const;
std::string MetaIndexFile(const char *Types) const;
std::string MetaIndexURI(const char *Type) const;
+#else
+ virtual std::string MetaIndexInfo(const char *Type) const;
+ virtual std::string MetaIndexFile(const char *Types) const;
+ virtual std::string MetaIndexURI(const char *Type) const;
+
+ virtual std::string LocalFileName() const;
#endif
std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;