X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b0d408547734100bf86781615f546487ecf390d9..0dd19915f44df0048d594d527797c62ab6195cc6:/apt-pkg/metaindex.cc diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index baf695f16..6e5792b78 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -34,12 +34,15 @@ metaIndex::metaIndex(std::string const &URI, std::string const &Dist, metaIndex::~metaIndex() { - if (Indexes == 0) - return; - for (std::vector::iterator I = (*Indexes).begin(); - I != (*Indexes).end(); ++I) - delete *I; - delete Indexes; + if (Indexes != 0) + { + for (std::vector::iterator I = (*Indexes).begin(); + I != (*Indexes).end(); ++I) + delete *I; + delete Indexes; + } + for (auto const &E: Entries) + delete E.second; } // one line Getters for public fields /*{{{*/ @@ -99,3 +102,20 @@ void metaIndex::swapLoad(metaIndex * const OldMetaIndex) /*{{{*/ std::swap(LoadedSuccessfully, OldMetaIndex->LoadedSuccessfully); } /*}}}*/ + +bool metaIndex::IsArchitectureSupported(std::string const &arch) const /*{{{*/ +{ + debReleaseIndex const * const deb = dynamic_cast(this); + if (deb != NULL) + return deb->IsArchitectureSupported(arch); + return true; +} + /*}}}*/ +bool metaIndex::IsArchitectureAllSupportedFor(IndexTarget const &target) const/*{{{*/ +{ + debReleaseIndex const * const deb = dynamic_cast(this); + if (deb != NULL) + return deb->IsArchitectureAllSupportedFor(target); + return true; +} + /*}}}*/