X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/88a8975f156e452d9f3ebe76822b236e8962ebba..6dc85f53d92b9763a1509a6472227c54bc70b01d:/apt-pkg/metaindex.cc diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 1632b928c..6e5792b78 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -3,6 +3,8 @@ #include #include +#include + #include #include /*}}}*/ @@ -32,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 /*{{{*/ @@ -97,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; +} + /*}}}*/