]>
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>
24 // ListParser::edspListParser - Constructor /*{{{*/
25 edspListParser::edspListParser(FileFd
*File
, std::string
const &Arch
) : debListParser(File
, Arch
)
28 // ListParser::NewVersion - Fill in the version structure /*{{{*/
29 bool edspListParser::NewVersion(pkgCache::VerIterator
&Ver
)
31 Ver
->ID
= Section
.FindI("APT-ID", Ver
->ID
);
32 return debListParser::NewVersion(Ver
);
35 // ListParser::Description - Return the description string /*{{{*/
36 // ---------------------------------------------------------------------
37 /* Sorry, no description for the resolvers… */
38 std::string
edspListParser::Description()
42 std::string
edspListParser::DescriptionLanguage()
46 MD5SumValue
edspListParser::Description_md5()
48 return MD5SumValue("");
51 // ListParser::VersionHash - Compute a unique hash for this version /*{{{*/
52 // ---------------------------------------------------------------------
54 unsigned short edspListParser::VersionHash()
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");
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
)
70 unsigned long state
= 0;
71 if (Section
.FindFlag("Hold",state
,pkgCache::State::Hold
) == false)
74 Pkg
->SelectedState
= pkgCache::State::Hold
;
77 if (Section
.FindFlag("Installed",state
,pkgCache::State::Installed
) == false)
81 Pkg
->CurrentState
= pkgCache::State::Installed
;
82 Pkg
->CurrentVer
= Ver
.Index();
88 // ListParser::LoadReleaseInfo - Load the release information /*{{{*/
89 APT_CONST
bool edspListParser::LoadReleaseInfo(pkgCache::PkgFileIterator
& /*FileI*/,
90 FileFd
& /*File*/, std::string
/*component*/)