]>
Commit | Line | Data |
---|---|---|
03e39e59 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
233b185f | 3 | // $Id: dpkgpm.h,v 1.8 2001/05/07 05:05:13 jgg Exp $ |
03e39e59 AL |
4 | /* ###################################################################### |
5 | ||
6 | DPKG Package Manager - Provide an interface to dpkg | |
7 | ||
8 | ##################################################################### */ | |
9 | /*}}}*/ | |
03e39e59 AL |
10 | #ifndef PKGLIB_DPKGPM_H |
11 | #define PKGLIB_DPKGPM_H | |
12 | ||
03e39e59 AL |
13 | #include <apt-pkg/packagemanager.h> |
14 | #include <vector> | |
b2e465d6 | 15 | #include <stdio.h> |
03e39e59 | 16 | |
233b185f AL |
17 | using std::vector; |
18 | ||
03e39e59 AL |
19 | class pkgDPkgPM : public pkgPackageManager |
20 | { | |
21 | protected: | |
5e457a93 | 22 | int pkgFailures; |
2a7e07c7 MV |
23 | |
24 | // used for progress reporting | |
25 | struct DpkgState | |
26 | { | |
27 | const char *state; // the dpkg state (e.g. "unpack") | |
28 | const char *str; // the human readable translation of the state | |
29 | }; | |
03e39e59 AL |
30 | |
31 | struct Item | |
32 | { | |
fc4b5c9f | 33 | enum Ops {Install, Configure, Remove, Purge} Op; |
03e39e59 AL |
34 | string File; |
35 | PkgIterator Pkg; | |
b2e465d6 | 36 | Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op), |
03e39e59 AL |
37 | File(File), Pkg(Pkg) {}; |
38 | Item() {}; | |
39 | ||
40 | }; | |
41 | vector<Item> List; | |
6dd55be7 AL |
42 | |
43 | // Helpers | |
44 | bool RunScripts(const char *Cnf); | |
db0c350f | 45 | bool RunScriptsWithPkgs(const char *Cnf); |
b2e465d6 | 46 | bool SendV2Pkgs(FILE *F); |
afb1e2e3 | 47 | |
5e457a93 MV |
48 | // apport integration |
49 | void WriteApportReport(const char *pkgpath, const char *errormsg); | |
50 | ||
03e39e59 AL |
51 | // The Actuall installation implementation |
52 | virtual bool Install(PkgIterator Pkg,string File); | |
53 | virtual bool Configure(PkgIterator Pkg); | |
fc4b5c9f | 54 | virtual bool Remove(PkgIterator Pkg,bool Purge = false); |
2a7e07c7 | 55 | virtual bool Go(int StatusFd=-1); |
281daf46 | 56 | virtual void Reset(); |
03e39e59 AL |
57 | |
58 | public: | |
59 | ||
b2e465d6 | 60 | pkgDPkgPM(pkgDepCache *Cache); |
03e39e59 AL |
61 | virtual ~pkgDPkgPM(); |
62 | }; | |
63 | ||
64 | #endif |