]>
git.saurik.com Git - apt.git/blob - apt-pkg/edsp/edsplistparser.cc
1 // -*- mode: cpp; mode: fold -*-
3 /* ######################################################################
5 Package Cache Generator - Generator for the cache structure.
7 This builds the cache structure from the abstract package list parser.
9 ##################################################################### */
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>
20 // ListParser::edspListParser - Constructor /*{{{*/
21 edspListParser::edspListParser(FileFd
*File
, string
const &Arch
) : debListParser(File
, Arch
)
24 // ListParser::NewVersion - Fill in the version structure /*{{{*/
25 bool edspListParser::NewVersion(pkgCache::VerIterator
&Ver
)
27 Ver
->ID
= Section
.FindI("APT-ID", Ver
->ID
);
28 return debListParser::NewVersion(Ver
);
31 // ListParser::Description - Return the description string /*{{{*/
32 // ---------------------------------------------------------------------
33 /* Sorry, no description for the resolvers… */
34 string
edspListParser::Description()
38 string
edspListParser::DescriptionLanguage()
42 MD5SumValue
edspListParser::Description_md5()
44 return MD5SumValue("");
47 // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/
48 // ---------------------------------------------------------------------
50 unsigned short edspListParser::VersionHash()
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");
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
)
66 unsigned long state
= 0;
67 if (Section
.FindFlag("Hold",state
,pkgCache::State::Hold
) == false)
70 Pkg
->SelectedState
= pkgCache::State::Hold
;
73 if (Section
.FindFlag("Installed",state
,pkgCache::State::Installed
) == false)
77 Pkg
->CurrentState
= pkgCache::State::Installed
;
78 Pkg
->CurrentVer
= Ver
.Index();
84 // ListParser::LoadReleaseInfo - Load the release information /*{{{*/
85 bool edspListParser::LoadReleaseInfo(pkgCache::PkgFileIterator
&FileI
,
86 FileFd
&File
, string component
)