]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/metaindex.cc
fileutl: simple_buffer: Add write() and full() methods
[apt.git] / apt-pkg / metaindex.cc
index 1632b928cfb57f4a1e40b3ab4f92207b44eea67c..fe948243ec57cef3150b163d975d4d4defdf1382 100644 (file)
@@ -3,6 +3,8 @@
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/metaindex.h>
 
+#include <apt-pkg/debmetaindex.h>
+
 #include <string>
 #include <vector>
                                                                        /*}}}*/
@@ -32,12 +34,15 @@ metaIndex::metaIndex(std::string const &URI, std::string const &Dist,
 
 metaIndex::~metaIndex()
 {
-   if (Indexes == 0)
-      return;
-   for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
-        I != (*Indexes).end(); ++I)
-      delete *I;
-   delete Indexes;
+   if (Indexes != 0)
+   {
+      for (std::vector<pkgIndexFile *>::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,12 @@ 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<debReleaseIndex const *>(this);
+   if (deb != NULL)
+      return deb->IsArchitectureSupported(arch);
+   return true;
+}
+                                                                       /*}}}*/