]> git.saurik.com Git - apt.git/blob - apt-pkg/metaindex.cc
pkgPolicy: Introduce storage and helpers for per-version pins
[apt.git] / apt-pkg / metaindex.cc
1 // Include Files /*{{{*/
2 #include <apt-pkg/pkgcachegen.h>
3 #include <apt-pkg/indexfile.h>
4 #include <apt-pkg/metaindex.h>
5
6 #include <stddef.h>
7
8 #include <string>
9 #include <vector>
10 /*}}}*/
11
12 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
13 std::string metaIndex::LocalFileName() const { return ""; }
14 #else
15 #include <apt-pkg/debmetaindex.h>
16 std::string metaIndex::LocalFileName() const
17 {
18 debReleaseIndex const * deb = dynamic_cast<debReleaseIndex const*>(this);
19 if (deb != NULL)
20 return deb->LocalFileName();
21
22 return "";
23 }
24 #endif
25
26 std::string metaIndex::Describe() const
27 {
28 return "Release";
29 }
30
31 pkgCache::RlsFileIterator metaIndex::FindInCache(pkgCache &Cache, bool const) const
32 {
33 return pkgCache::RlsFileIterator(Cache);
34 }
35
36 bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const
37 {
38 return Gen.SelectReleaseFile("", "");
39 }
40
41
42 metaIndex::metaIndex(std::string const &URI, std::string const &Dist,
43 char const * const Type)
44 : Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
45 {
46 /* nothing */
47 }
48
49 metaIndex::~metaIndex()
50 {
51 if (Indexes == 0)
52 return;
53 for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
54 I != (*Indexes).end(); ++I)
55 delete *I;
56 delete Indexes;
57 }