]>
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 /*{{{*/
14 #include <apt-pkg/edsplistparser.h>
15 #include <apt-pkg/md5.h>
16 #include <apt-pkg/deblistparser.h>
17 #include <apt-pkg/pkgcache.h>
18 #include <apt-pkg/cacheiterators.h>
19 #include <apt-pkg/tagfile.h>
23 // ListParser::edspListParser - Constructor /*{{{*/
24 edspListParser::edspListParser(FileFd
*File
) : debListParser(File
), d(NULL
)
27 // ListParser::NewVersion - Fill in the version structure /*{{{*/
28 bool edspListParser::NewVersion(pkgCache::VerIterator
&Ver
)
30 Ver
->ID
= Section
.FindI("APT-ID", Ver
->ID
);
31 return debListParser::NewVersion(Ver
);
34 // ListParser::Description - Return the description string /*{{{*/
35 // ---------------------------------------------------------------------
36 /* Sorry, no description for the resolvers… */
37 std::string
edspListParser::Description()
41 std::string
edspListParser::DescriptionLanguage()
45 MD5SumValue
edspListParser::Description_md5()
47 return MD5SumValue("");
50 // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/
51 // ---------------------------------------------------------------------
53 unsigned short edspListParser::VersionHash()
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");
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
)
69 unsigned long state
= 0;
70 if (Section
.FindFlag("Hold",state
,pkgCache::State::Hold
) == false)
73 Pkg
->SelectedState
= pkgCache::State::Hold
;
76 if (Section
.FindFlag("Installed",state
,pkgCache::State::Installed
) == false)
80 Pkg
->CurrentState
= pkgCache::State::Installed
;
81 Pkg
->CurrentVer
= Ver
.Index();
87 // ListParser::LoadReleaseInfo - Load the release information /*{{{*/
88 APT_CONST
bool edspListParser::LoadReleaseInfo(pkgCache::RlsFileIterator
& /*FileI*/,
89 FileFd
& /*File*/, std::string
const &/*component*/)
95 edspListParser::~edspListParser() {}