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