]>
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 | ||
21 | #include <string> | |
6d38011b DK |
22 | /*}}}*/ |
23 | ||
24 | // ListParser::edspListParser - Constructor /*{{{*/ | |
7f8c0eed | 25 | edspListParser::edspListParser(FileFd *File) : debListParser(File), d(NULL) |
6d38011b DK |
26 | {} |
27 | /*}}}*/ | |
28 | // ListParser::NewVersion - Fill in the version structure /*{{{*/ | |
29 | bool edspListParser::NewVersion(pkgCache::VerIterator &Ver) | |
30 | { | |
31 | Ver->ID = Section.FindI("APT-ID", Ver->ID); | |
32 | return debListParser::NewVersion(Ver); | |
33 | } | |
34 | /*}}}*/ | |
35 | // ListParser::Description - Return the description string /*{{{*/ | |
36 | // --------------------------------------------------------------------- | |
37 | /* Sorry, no description for the resolvers… */ | |
8f3ba4e8 | 38 | std::string edspListParser::Description() |
6d38011b DK |
39 | { |
40 | return ""; | |
41 | } | |
8f3ba4e8 | 42 | std::string edspListParser::DescriptionLanguage() |
6d38011b DK |
43 | { |
44 | return ""; | |
45 | } | |
46 | MD5SumValue edspListParser::Description_md5() | |
47 | { | |
48 | return MD5SumValue(""); | |
49 | } | |
50 | /*}}}*/ | |
51 | // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/ | |
52 | // --------------------------------------------------------------------- | |
53 | /* */ | |
54 | unsigned short edspListParser::VersionHash() | |
55 | { | |
56 | if (Section.Exists("APT-Hash") == true) | |
57 | return Section.FindI("APT-Hash"); | |
58 | else if (Section.Exists("APT-ID") == true) | |
59 | return Section.FindI("APT-ID"); | |
60 | return 0; | |
61 | } | |
62 | /*}}}*/ | |
63 | // ListParser::ParseStatus - Parse the status field /*{{{*/ | |
64 | // --------------------------------------------------------------------- | |
65 | /* The Status: line here is not a normal dpkg one but just one which tells | |
66 | use if the package is installed or not, where missing means not. */ | |
67 | bool edspListParser::ParseStatus(pkgCache::PkgIterator &Pkg, | |
68 | pkgCache::VerIterator &Ver) | |
69 | { | |
9221da7e DK |
70 | unsigned long state = 0; |
71 | if (Section.FindFlag("Hold",state,pkgCache::State::Hold) == false) | |
6d38011b | 72 | return false; |
9221da7e DK |
73 | if (state != 0) |
74 | Pkg->SelectedState = pkgCache::State::Hold; | |
6d38011b | 75 | |
9221da7e | 76 | state = 0; |
b195733d DK |
77 | if (Section.FindFlag("Installed",state,pkgCache::State::Installed) == false) |
78 | return false; | |
79 | if (state != 0) | |
6d38011b | 80 | { |
b195733d DK |
81 | Pkg->CurrentState = pkgCache::State::Installed; |
82 | Pkg->CurrentVer = Ver.Index(); | |
6d38011b | 83 | } |
b195733d | 84 | |
6d38011b DK |
85 | return true; |
86 | } | |
87 | /*}}}*/ | |
88 | // ListParser::LoadReleaseInfo - Load the release information /*{{{*/ | |
b07aeb1a DK |
89 | APT_CONST bool edspListParser::LoadReleaseInfo(pkgCache::RlsFileIterator & /*FileI*/, |
90 | FileFd & /*File*/, std::string const &/*component*/) | |
6d38011b DK |
91 | { |
92 | return true; | |
93 | } | |
94 | /*}}}*/ | |
c8a4ce6c DK |
95 | |
96 | edspListParser::~edspListParser() {} |