releasing version 0.8.16~exp3
[ntk/apt.git] / apt-pkg / edsp / edsplistparser.cc
CommitLineData
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 /*{{{*/
21edspListParser::edspListParser(FileFd *File, string const &Arch) : debListParser(File, Arch)
22{}
23 /*}}}*/
24// ListParser::NewVersion - Fill in the version structure /*{{{*/
25bool 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… */
34string edspListParser::Description()
35{
36 return "";
37}
38string edspListParser::DescriptionLanguage()
39{
40 return "";
41}
42MD5SumValue edspListParser::Description_md5()
43{
44 return MD5SumValue("");
45}
46 /*}}}*/
47// ListParser::VersionHash - Compute a unique hash for this version /*{{{*/
48// ---------------------------------------------------------------------
49/* */
50unsigned 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. */
63bool edspListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
64 pkgCache::VerIterator &Ver)
65{
9221da7e
DK
66 unsigned long state = 0;
67 if (Section.FindFlag("Hold",state,pkgCache::State::Hold) == false)
6d38011b 68 return false;
9221da7e
DK
69 if (state != 0)
70 Pkg->SelectedState = pkgCache::State::Hold;
6d38011b 71
9221da7e 72 state = 0;
b195733d
DK
73 if (Section.FindFlag("Installed",state,pkgCache::State::Installed) == false)
74 return false;
75 if (state != 0)
6d38011b 76 {
b195733d
DK
77 Pkg->CurrentState = pkgCache::State::Installed;
78 Pkg->CurrentVer = Ver.Index();
6d38011b 79 }
b195733d 80
6d38011b
DK
81 return true;
82}
83 /*}}}*/
84// ListParser::LoadReleaseInfo - Load the release information /*{{{*/
85bool edspListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
86 FileFd &File, string component)
87{
88 return true;
89}
90 /*}}}*/