X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/916e5cb41edfa015fd8ec42ba140eb7c0c4cb511..1b36b5fa1b8dbd76aec7ddd4ffe72f8515c29038:/apt-pkg/metaindex.cc?ds=inline diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 2292ac388..d96349974 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -1,44 +1,57 @@ +// Include Files /*{{{*/ +#include +#include +#include -#include - -#include "init.h" -#include "metaindex.h" +#include +#include +#include + /*}}}*/ #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) -string metaIndex::MetaIndexInfo(const char *Type) const +std::string metaIndex::LocalFileName() const { return ""; } +#else +#include +std::string metaIndex::LocalFileName() const { - string Info = ::URI::SiteOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Info += Dist; - } - else - Info += Dist; - Info += " "; - Info += Type; - return Info; + debReleaseIndex const * deb = dynamic_cast(this); + if (deb != NULL) + return deb->LocalFileName(); + + return ""; } +#endif -string metaIndex::MetaIndexFile(const char *Type) const +std::string metaIndex::Describe() const { - return _config->FindDir("Dir::State::lists") + - URItoFileName(MetaIndexURI(Type)); + return "Release"; } -string metaIndex::MetaIndexURI(const char *Type) const +pkgCache::RlsFileIterator metaIndex::FindInCache(pkgCache &Cache, bool const) 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; + return pkgCache::RlsFileIterator(Cache); +} + +bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const +{ + return Gen.SelectReleaseFile("", ""); +} + + +metaIndex::metaIndex(std::string const &URI, std::string const &Dist, + char const * const Type) +: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false) +{ + /* nothing */ +} + +metaIndex::~metaIndex() +{ + if (Indexes == 0) + return; + for (std::vector::iterator I = (*Indexes).begin(); + I != (*Indexes).end(); ++I) + delete *I; + delete Indexes; } -#endif