]>
Commit | Line | Data |
---|---|---|
03e39e59 AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
b2e465d6 | 3 | // $Id: dpkgpm.h,v 1.7 2001/02/20 07:03:17 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 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface "apt-pkg/dpkgpm.h" | |
15 | #endif | |
16 | ||
17 | #include <apt-pkg/packagemanager.h> | |
18 | #include <vector> | |
b2e465d6 | 19 | #include <stdio.h> |
03e39e59 AL |
20 | |
21 | class pkgDPkgPM : public pkgPackageManager | |
22 | { | |
23 | protected: | |
24 | ||
25 | struct Item | |
26 | { | |
fc4b5c9f | 27 | enum Ops {Install, Configure, Remove, Purge} Op; |
03e39e59 AL |
28 | string File; |
29 | PkgIterator Pkg; | |
b2e465d6 | 30 | Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op), |
03e39e59 AL |
31 | File(File), Pkg(Pkg) {}; |
32 | Item() {}; | |
33 | ||
34 | }; | |
35 | vector<Item> List; | |
6dd55be7 AL |
36 | |
37 | // Helpers | |
38 | bool RunScripts(const char *Cnf); | |
db0c350f | 39 | bool RunScriptsWithPkgs(const char *Cnf); |
b2e465d6 | 40 | bool SendV2Pkgs(FILE *F); |
6dd55be7 | 41 | |
03e39e59 AL |
42 | // The Actuall installation implementation |
43 | virtual bool Install(PkgIterator Pkg,string File); | |
44 | virtual bool Configure(PkgIterator Pkg); | |
fc4b5c9f | 45 | virtual bool Remove(PkgIterator Pkg,bool Purge = false); |
03e39e59 | 46 | virtual bool Go(); |
281daf46 | 47 | virtual void Reset(); |
03e39e59 AL |
48 | |
49 | public: | |
50 | ||
b2e465d6 | 51 | pkgDPkgPM(pkgDepCache *Cache); |
03e39e59 AL |
52 | virtual ~pkgDPkgPM(); |
53 | }; | |
54 | ||
55 | #endif |