summaryrefslogtreecommitdiffstats
path: root/adept/libadept/dpkgpm.h
blob: b899693a022d1c2746281af06b2fed13382c9300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/** -*- C++ -*-
	@file adept/dpkgpm.h
	@author Peter Rockai <[email protected]>
*/

#include <apt-pkg/dpkgpm.h>
#include <string>
#include <vector>
#include <map>

#ifndef DPKGPM_H
#  define DPKGPM_H

namespace aptFront {

class DPkgPM : public pkgDPkgPM {
protected:
    enum Op { ORemove, OPurge, OConfigure, OInstall };
    Op m_currentOp;
    int m_dpkgPipe[2];
    int m_scriptPipe[2];
    unsigned m_version;
    std::string m_statusBuffer;
    typedef std::pair< Op, std::string > OpAndStatus;
    typedef std::map< std::pair< OpAndStatus, std::string >, int > SeenOps;
    SeenOps m_seenOps;
    int m_totalOpCount;
    int m_seenOpCount;
public:
    DPkgPM (pkgDepCache *C);
    virtual bool Go ( int );
    virtual void computeTotals();
    virtual bool setupArgs (char *const **a, std::vector<Item>::iterator &I);
    virtual bool forkDpkg (char *const argv[]);
    virtual bool forkScript (const char *, bool);
    virtual bool runScripts (const char *, bool);
    virtual bool setupChild ();
    virtual void setupScript (const char *, bool);
    virtual void dpkgMonitor (void);
    virtual bool SendV1Pkgs (FILE *);
    virtual bool feedPackages (void);
    virtual void updateStatus( std::string pkg, std::string ev, std::string r );
};

}


#endif /* ifndef DPKGPM_H */