]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/dpkgpm.h
apt-pkg/deb/dpkgpm.{cc,h}:
[apt.git] / apt-pkg / deb / dpkgpm.h
CommitLineData
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
17using std::vector;
18
03e39e59
AL
19class pkgDPkgPM : public pkgPackageManager
20{
21 protected:
2a7e07c7
MV
22
23 // used for progress reporting
24 struct DpkgState
25 {
26 const char *state; // the dpkg state (e.g. "unpack")
27 const char *str; // the human readable translation of the state
28 };
03e39e59
AL
29
30 struct Item
31 {
fc4b5c9f 32 enum Ops {Install, Configure, Remove, Purge} Op;
03e39e59
AL
33 string File;
34 PkgIterator Pkg;
b2e465d6 35 Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
03e39e59
AL
36 File(File), Pkg(Pkg) {};
37 Item() {};
38
39 };
40 vector<Item> List;
6dd55be7
AL
41
42 // Helpers
43 bool RunScripts(const char *Cnf);
db0c350f 44 bool RunScriptsWithPkgs(const char *Cnf);
b2e465d6 45 bool SendV2Pkgs(FILE *F);
afb1e2e3 46
ceabc520
MV
47 // input processing
48 void DoStdin(int master);
49 void DoTerminalPty(int master, FILE *out);
50 // void DoDpkgStatusFd();
51
03e39e59
AL
52 // The Actuall installation implementation
53 virtual bool Install(PkgIterator Pkg,string File);
54 virtual bool Configure(PkgIterator Pkg);
fc4b5c9f 55 virtual bool Remove(PkgIterator Pkg,bool Purge = false);
2a7e07c7 56 virtual bool Go(int StatusFd=-1);
281daf46 57 virtual void Reset();
03e39e59
AL
58
59 public:
60
b2e465d6 61 pkgDPkgPM(pkgDepCache *Cache);
03e39e59
AL
62 virtual ~pkgDPkgPM();
63};
64
65#endif