]>
Commit | Line | Data |
---|---|---|
6d38011b DK |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
3 | /* ###################################################################### | |
4 | ||
5 | Package Cache Generator - Generator for the cache structure. | |
6 | ||
7 | This builds the cache structure from the abstract package list parser. | |
8 | ||
9 | ##################################################################### */ | |
10 | /*}}}*/ | |
11 | // Include Files /*{{{*/ | |
ea542140 DK |
12 | #include <config.h> |
13 | ||
6d38011b | 14 | #include <apt-pkg/edsplistparser.h> |
6d38011b | 15 | #include <apt-pkg/md5.h> |
453b82a3 DK |
16 | #include <apt-pkg/deblistparser.h> |
17 | #include <apt-pkg/pkgcache.h> | |
18 | #include <apt-pkg/cacheiterators.h> | |
19 | #include <apt-pkg/tagfile.h> | |
20 | ||
6d38011b DK |
21 | /*}}}*/ |
22 | ||
23 | // ListParser::edspListParser - Constructor /*{{{*/ | |
7f8c0eed | 24 | edspListParser::edspListParser(FileFd *File) : debListParser(File), d(NULL) |
6d38011b DK |
25 | {} |
26 | /*}}}*/ | |
27 | // ListParser::NewVersion - Fill in the version structure /*{{{*/ | |
28 | bool edspListParser::NewVersion(pkgCache::VerIterator &Ver) | |
29 | { | |
30 | Ver->ID = Section.FindI("APT-ID", Ver->ID); | |
31 | return debListParser::NewVersion(Ver); | |
32 | } | |
33 | /*}}}*/ | |
34 | // ListParser::Description - Return the description string /*{{{*/ | |
35 | // --------------------------------------------------------------------- | |
36 | /* Sorry, no description for the resolvers… */ | |
8f3ba4e8 | 37 | std::string edspListParser::Description() |
6d38011b DK |
38 | { |
39 | return ""; | |
40 | } | |
8f3ba4e8 | 41 | std::string edspListParser::DescriptionLanguage() |
6d38011b DK |
42 | { |
43 | return ""; | |
44 | } | |
45 | MD5SumValue edspListParser::Description_md5() | |
46 | { | |
47 | return MD5SumValue(""); | |
48 | } | |
49 | /*}}}*/ | |
50 | // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/ | |
51 | // --------------------------------------------------------------------- | |
52 | /* */ | |
53 | unsigned short edspListParser::VersionHash() | |
54 | { | |
55 | if (Section.Exists("APT-Hash") == true) | |
56 | return Section.FindI("APT-Hash"); | |
57 | else if (Section.Exists("APT-ID") == true) | |
58 | return Section.FindI("APT-ID"); | |
59 | return 0; | |
60 | } | |
61 | /*}}}*/ | |
62 | // ListParser::ParseStatus - Parse the status field /*{{{*/ | |
63 | // --------------------------------------------------------------------- | |
64 | /* The Status: line here is not a normal dpkg one but just one which tells | |
65 | use if the package is installed or not, where missing means not. */ | |
66 | bool edspListParser::ParseStatus(pkgCache::PkgIterator &Pkg, | |
67 | pkgCache::VerIterator &Ver) | |
68 | { | |
9221da7e DK |
69 | unsigned long state = 0; |
70 | if (Section.FindFlag("Hold",state,pkgCache::State::Hold) == false) | |
6d38011b | 71 | return false; |
9221da7e DK |
72 | if (state != 0) |
73 | Pkg->SelectedState = pkgCache::State::Hold; | |
6d38011b | 74 | |
9221da7e | 75 | state = 0; |
b195733d DK |
76 | if (Section.FindFlag("Installed",state,pkgCache::State::Installed) == false) |
77 | return false; | |
78 | if (state != 0) | |
6d38011b | 79 | { |
b195733d DK |
80 | Pkg->CurrentState = pkgCache::State::Installed; |
81 | Pkg->CurrentVer = Ver.Index(); | |
6d38011b | 82 | } |
b195733d | 83 | |
6d38011b DK |
84 | return true; |
85 | } | |
86 | /*}}}*/ | |
87 | // ListParser::LoadReleaseInfo - Load the release information /*{{{*/ | |
b07aeb1a DK |
88 | APT_CONST bool edspListParser::LoadReleaseInfo(pkgCache::RlsFileIterator & /*FileI*/, |
89 | FileFd & /*File*/, std::string const &/*component*/) | |
6d38011b DK |
90 | { |
91 | return true; | |
92 | } | |
93 | /*}}}*/ | |
c8a4ce6c DK |
94 | |
95 | edspListParser::~edspListParser() {} |