From 916e5cb41edfa015fd8ec42ba140eb7c0c4cb511 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Dec 2013 17:58:36 +0100 Subject: add #ifdefed ABI break & cleaner solution once the abi break is in place --- apt-pkg/metaindex.cc | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 apt-pkg/metaindex.cc (limited to 'apt-pkg/metaindex.cc') diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc new file mode 100644 index 000000000..2292ac388 --- /dev/null +++ b/apt-pkg/metaindex.cc @@ -0,0 +1,44 @@ + +#include + +#include "init.h" +#include "metaindex.h" + + +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) +string metaIndex::MetaIndexInfo(const char *Type) const +{ + string Info = ::URI::SiteOnly(URI) + ' '; + if (Dist[Dist.size() - 1] == '/') + { + if (Dist != "/") + Info += Dist; + } + else + Info += Dist; + Info += " "; + Info += Type; + return Info; +} + +string metaIndex::MetaIndexFile(const char *Type) const +{ + return _config->FindDir("Dir::State::lists") + + URItoFileName(MetaIndexURI(Type)); +} + +string metaIndex::MetaIndexURI(const char *Type) const +{ + string Res; + + if (Dist == "/") + Res = URI; + else if (Dist[Dist.size()-1] == '/') + Res = URI + Dist; + else + Res = URI + "dists/" + Dist + "/"; + + Res += Type; + return Res; +} +#endif -- cgit v1.2.3