summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-07-19 10:40:39 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-07-19 10:40:39 +0100
commit66f5cecdadbaff7b414eaa0bd446136d3184f043 (patch)
treec526aeb7f771d9ff4d27341646fa7d7f2540c55b /apt-pkg/deb/dpkgpm.h
parent76d940371391ac601369ea6b487c87fe65f1fd26 (diff)
parentff56e98015b17c73a3f1aacf3deef5ec4ef4e21b (diff)
merge the local changes back
Diffstat (limited to 'apt-pkg/deb/dpkgpm.h')
-rw-r--r--apt-pkg/deb/dpkgpm.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h
index a1466878d..c552b20c9 100644
--- a/apt-pkg/deb/dpkgpm.h
+++ b/apt-pkg/deb/dpkgpm.h
@@ -12,21 +12,42 @@
#include <apt-pkg/packagemanager.h>
#include <vector>
+#include <map>
#include <stdio.h>
using std::vector;
+using std::map;
+
class pkgDPkgPM : public pkgPackageManager
{
+ private:
+
+ // the buffer we use for the dpkg status-fd reading
+ char dpkgbuf[1024];
+ int dpkgbuf_pos;
+
protected:
- // used for progress reporting
+ // progress reporting
struct DpkgState
{
const char *state; // the dpkg state (e.g. "unpack")
const char *str; // the human readable translation of the state
};
-
+
+ // the dpkg states that the pkg will run through, the string is
+ // the package, the vector contains the dpkg states that the package
+ // will go through
+ map<string,vector<struct DpkgState> > PackageOps;
+ // the dpkg states that are already done; the string is the package
+ // the int is the state that is already done (e.g. a package that is
+ // going to be install is already in state "half-installed")
+ map<string,int> PackageOpsDone;
+ // progress reporting
+ int PackagesDone;
+ int PackagesTotal;
+
struct Item
{
enum Ops {Install, Configure, Remove, Purge} Op;
@@ -47,7 +68,8 @@ class pkgDPkgPM : public pkgPackageManager
// input processing
void DoStdin(int master);
void DoTerminalPty(int master, FILE *out);
- // void DoDpkgStatusFd();
+ void DoDpkgStatusFd(int statusfd, int OutStatusFd);
+ void ProcessDpkgStatusLine(int OutStatusFd, char *line);
// The Actuall installation implementation
virtual bool Install(PkgIterator Pkg,string File);