X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b0d408547734100bf86781615f546487ecf390d9..cc0a4c82b3c132abba9b9ec35fd61bc8b45a1b80:/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; +} + /*}}}*/