Fixed up dpkginit and acquire stuff..
[ntk/apt.git] / apt-pkg / deb / dpkgpm.h
CommitLineData
03e39e59
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
fc4b5c9f 3// $Id: dpkgpm.h,v 1.5 1999/07/09 04:11:34 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>
19
20class pkgDPkgPM : public pkgPackageManager
21{
22 protected:
23
24 struct Item
25 {
fc4b5c9f 26 enum Ops {Install, Configure, Remove, Purge} Op;
03e39e59
AL
27 string File;
28 PkgIterator Pkg;
29 Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
30 File(File), Pkg(Pkg) {};
31 Item() {};
32
33 };
34 vector<Item> List;
6dd55be7
AL
35
36 // Helpers
37 bool RunScripts(const char *Cnf);
38
03e39e59
AL
39 // The Actuall installation implementation
40 virtual bool Install(PkgIterator Pkg,string File);
41 virtual bool Configure(PkgIterator Pkg);
fc4b5c9f 42 virtual bool Remove(PkgIterator Pkg,bool Purge = false);
03e39e59 43 virtual bool Go();
281daf46 44 virtual void Reset();
03e39e59
AL
45
46 public:
47
48 pkgDPkgPM(pkgDepCache &Cache);
49 virtual ~pkgDPkgPM();
50};
51
52#endif