apt 3.0.3
commandline package manager
edsp.h
Go to the documentation of this file.
1// -*- mode: cpp; mode: fold -*-
8 /*}}}*/
9#ifndef PKGLIB_EDSP_H
10#define PKGLIB_EDSP_H
11
12#include <apt-pkg/cacheset.h>
13#include <apt-pkg/macros.h>
14#include <apt-pkg/pkgcache.h>
15
16#include <cstdio>
17
18#include <list>
19#include <string>
20#include <vector>
21
22
23class pkgDepCache;
24class OpProgress;
25
26namespace EDSP /*{{{*/
27{
28 namespace Request
29 {
30 enum Flags
31 {
32 AUTOREMOVE = (1 << 0),
33 UPGRADE_ALL = (1 << 1),
34 FORBID_NEW_INSTALL = (1 << 2),
35 FORBID_REMOVE = (1 << 3),
36 };
37 }
52 APT_PUBLIC bool WriteRequest(pkgDepCache &Cache, FileFd &output,
53 unsigned int const flags = 0,
54 OpProgress *Progress = NULL);
55
73 APT_PUBLIC bool WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress = NULL);
74
90 APT_PUBLIC bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
91 std::vector<bool> const &pkgset,
92 OpProgress *Progress = NULL);
93
107 APT_PUBLIC bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
108 OpProgress *Progress = NULL);
109
124 APT_PUBLIC bool ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL);
125
142 APT_PUBLIC bool ReadRequest(int const input, std::list<std::string> &install,
143 std::list<std::string> &remove, unsigned int &flags);
144
157 APT_PUBLIC bool ApplyRequest(std::list<std::string> const &install,
158 std::list<std::string> const &remove,
159 pkgDepCache &Cache);
160
173 APT_PUBLIC bool WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache::VerIterator const &Ver);
174
181 APT_PUBLIC bool WriteProgress(unsigned short const percent, const char* const message, FileFd &output);
182
198 APT_PUBLIC bool WriteError(char const * const uuid, std::string const &message, FileFd &output);
199
200
212 APT_PUBLIC pid_t ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/);
213
226 APT_PUBLIC bool ResolveExternal(const char* const solver, pkgDepCache &Cache,
227 unsigned int const flags = 0,
228 OpProgress *Progress = NULL);
229}
230 /*}}}*/
232namespace EIPP /*{{{*/
233{
234 namespace Request
235 {
236 enum Flags
237 {
239 NO_IMMEDIATE_CONFIGURATION = (1 << 1),
241 };
242 }
243
244 APT_HIDDEN bool WriteRequest(pkgDepCache &Cache, FileFd &output,
245 unsigned int const flags, OpProgress * const Progress);
246 APT_HIDDEN bool WriteScenario(pkgDepCache &Cache, FileFd &output,
247 OpProgress * const Progress);
248
249 APT_HIDDEN bool OrderInstall(char const * const planner, pkgPackageManager * const PM,
250 unsigned int const version, OpProgress * const Progress);
251 APT_HIDDEN bool ReadResponse(int const input, pkgPackageManager * const PM,
252 OpProgress * const Progress);
253
254 enum class PKG_ACTION
255 {
256 NOOP,
257 INSTALL,
258 REINSTALL,
259 REMOVE
260 };
261 APT_PUBLIC bool ReadRequest(int const input,
262 std::list<std::pair<std::string,PKG_ACTION>> &actions,
263 unsigned int &flags);
264 APT_PUBLIC bool ApplyRequest(std::list<std::pair<std::string,PKG_ACTION>> &actions,
265 pkgDepCache &Cache);
266}
267 /*}}}*/
268#endif
Definition fileutl.h:43
Definition progress.h:30
Definition depcache.h:63
Definition packagemanager.h:49
APT_PUBLIC bool ApplyRequest(std::list< std::string > const &install, std::list< std::string > const &remove, pkgDepCache &Cache)
takes the request lists and applies it on the cache
Definition edsp.cc:638
APT_PUBLIC bool ReadRequest(int const input, std::list< std::string > &install, std::list< std::string > &remove, unsigned int &flags)
search and read the request stanza for action later
Definition edsp.cc:584
Flags
Definition edsp.h:31
@ AUTOREMOVE
Definition edsp.h:32
@ ALLOW_TEMPORARY_REMOVE_OF_ESSENTIALS
Definition edsp.h:240
@ FORBID_NEW_INSTALL
Definition edsp.h:34
@ IMMEDIATE_CONFIGURATION_ALL
Definition edsp.h:238
pkgCache - Structure definitions for the cache file