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