dpkgpm.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: dpkgpm.h,v 1.6 1999/07/30 06:15:14 jgg Exp $
  4. /* ######################################################################
  5. DPKG Package Manager - Provide an interface to dpkg
  6. ##################################################################### */
  7. /*}}}*/
  8. #ifndef PKGLIB_DPKGPM_H
  9. #define PKGLIB_DPKGPM_H
  10. #ifdef __GNUG__
  11. #pragma interface "apt-pkg/dpkgpm.h"
  12. #endif
  13. #include <apt-pkg/packagemanager.h>
  14. #include <vector>
  15. class pkgDPkgPM : public pkgPackageManager
  16. {
  17. protected:
  18. struct Item
  19. {
  20. enum Ops {Install, Configure, Remove, Purge} Op;
  21. string File;
  22. PkgIterator Pkg;
  23. Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
  24. File(File), Pkg(Pkg) {};
  25. Item() {};
  26. };
  27. vector<Item> List;
  28. // Helpers
  29. bool RunScripts(const char *Cnf);
  30. bool RunScriptsWithPkgs(const char *Cnf);
  31. // The Actuall installation implementation
  32. virtual bool Install(PkgIterator Pkg,string File);
  33. virtual bool Configure(PkgIterator Pkg);
  34. virtual bool Remove(PkgIterator Pkg,bool Purge = false);
  35. virtual bool Go();
  36. virtual void Reset();
  37. public:
  38. pkgDPkgPM(pkgDepCache &Cache);
  39. virtual ~pkgDPkgPM();
  40. };
  41. #endif