]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/dpkgpm.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: dpkgpm.h,v 1.8 2001/05/07 05:05:13 jgg Exp $
4 /* ######################################################################
6 DPKG Package Manager - Provide an interface to dpkg
8 ##################################################################### */
10 #ifndef PKGLIB_DPKGPM_H
11 #define PKGLIB_DPKGPM_H
13 #include <apt-pkg/packagemanager.h>
17 #include <apt-pkg/macros.h>
19 #ifndef APT_8_CLEANER_HEADERS
24 class pkgDPkgPMPrivate
;
26 class pkgDPkgPM
: public pkgPackageManager
31 /** \brief record the disappear action and handle accordingly
33 dpkg let packages disappear then they have no files any longer and
34 nothing depends on them. We need to collect this as dpkg as well as
35 APT doesn't know beforehand that the package will disappear, so the
36 only possible option is to tell the user afterwards about it.
37 To enhance the experience we also try to forward the auto-install
38 flag so the disappear-causer(s) are not autoremoved next time -
39 for the transfer to happen the disappeared version needs to depend
40 on the package the flag should be forwarded to and this package
41 needs to declare a Replaces on the disappeared package.
42 \param pkgname Name of the package that disappeared
44 void handleDisappearAction(std::string
const &pkgname
);
52 const char *state
; // the dpkg state (e.g. "unpack")
53 const char *str
; // the human readable translation of the state
56 // the dpkg states that the pkg will run through, the string is
57 // the package, the vector contains the dpkg states that the package
59 std::map
<std::string
,std::vector
<struct DpkgState
> > PackageOps
;
60 // the dpkg states that are already done; the string is the package
61 // the int is the state that is already done (e.g. a package that is
62 // going to be install is already in state "half-installed")
63 std::map
<std::string
,unsigned int> PackageOpsDone
;
66 unsigned int PackagesDone
;
67 unsigned int PackagesTotal
;
71 enum Ops
{Install
, Configure
, Remove
, Purge
, ConfigurePending
, TriggersPending
} Op
;
74 Item(Ops Op
,PkgIterator Pkg
,std::string File
= "") : Op(Op
),
75 File(File
), Pkg(Pkg
) {};
79 std::vector
<Item
> List
;
82 bool RunScriptsWithPkgs(const char *Cnf
);
83 __deprecated
bool SendV2Pkgs(FILE *F
);
84 bool SendPkgsInfo(FILE * const F
, unsigned int const &Version
);
85 void WriteHistoryTag(std::string
const &tag
, std::string value
);
88 void WriteApportReport(const char *pkgpath
, const char *errormsg
);
95 void DoStdin(int master
);
96 void DoTerminalPty(int master
);
97 void DoDpkgStatusFd(int statusfd
, int OutStatusFd
);
98 void ProcessDpkgStatusLine(int OutStatusFd
, char *line
);
100 // The Actuall installation implementation
101 virtual bool Install(PkgIterator Pkg
,std::string File
);
102 virtual bool Configure(PkgIterator Pkg
);
103 virtual bool Remove(PkgIterator Pkg
,bool Purge
= false);
104 virtual bool Go(int StatusFd
=-1);
105 virtual void Reset();
109 pkgDPkgPM(pkgDepCache
*Cache
);
110 virtual ~pkgDPkgPM();
113 void SigINT(int sig
);