tell the resolver a package is set on hold if it was set by the user
[ntk/apt.git] / apt-pkg / edsp.h
CommitLineData
6d38011b
DK
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4 Set of methods to help writing and reading everything needed for EDSP
5 ##################################################################### */
6 /*}}}*/
c3b85126
DK
7#ifndef PKGLIB_EDSP_H
8#define PKGLIB_EDSP_H
6d38011b
DK
9
10#include <apt-pkg/depcache.h>
d4f626ff 11#include <apt-pkg/cacheset.h>
6d38011b 12
29099cb6
DK
13#include <string>
14
c3b85126 15class EDSP /*{{{*/
6d38011b 16{
d4f626ff
DK
17 // we could use pkgCache::DepType and ::Priority, but these would be localized stringsā€¦
18 static const char * const PrioMap[];
19 static const char * const DepMap[];
20
6d5bd614 21 bool static ReadLine(int const input, std::string &line);
40795fca 22 bool static StringToBool(char const *answer, bool const defValue);
6d5bd614 23
d4f626ff
DK
24 void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output,
25 pkgCache::PkgIterator const &Pkg,
26 pkgCache::VerIterator const &Ver);
27 void static WriteScenarioDependency(pkgDepCache &Cache, FILE* output,
28 pkgCache::PkgIterator const &Pkg,
29 pkgCache::VerIterator const &Ver);
30 void static WriteScenarioLimitedDependency(pkgDepCache &Cache, FILE* output,
31 pkgCache::PkgIterator const &Pkg,
32 pkgCache::VerIterator const &Ver,
33 APT::PackageSet const &pkgset);
6d38011b 34public:
93794bc9 35 bool static WriteRequest(pkgDepCache &Cache, FILE* output,
40795fca
DK
36 bool const upgrade = false,
37 bool const distUpgrade = false,
38 bool const autoRemove = false);
29099cb6 39 bool static WriteScenario(pkgDepCache &Cache, FILE* output);
d4f626ff
DK
40 bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
41 APT::PackageSet const &pkgset);
2029276f 42 bool static ReadResponse(int const input, pkgDepCache &Cache);
29099cb6
DK
43
44 // ReadScenario is provided by the listparser infrastructure
6d5bd614 45 bool static ReadRequest(int const input, std::list<std::string> &install,
40795fca
DK
46 std::list<std::string> &remove, bool &upgrade,
47 bool &distUpgrade, bool &autoRemove);
29099cb6
DK
48 bool static ApplyRequest(std::list<std::string> const &install,
49 std::list<std::string> const &remove,
50 pkgDepCache &Cache);
e3674d91 51 bool static WriteSolution(pkgDepCache &Cache, FILE* output);
e876223c 52 bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output);
29099cb6
DK
53 bool static WriteError(std::string const &message, FILE* output);
54
ac5fbff8 55 bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);
741b7da9
DK
56 bool static ResolveExternal(const char* const solver, pkgDepCache &Cache,
57 bool const upgrade, bool const distUpgrade,
58 bool const autoRemove);
6d38011b
DK
59};
60 /*}}}*/
61#endif