dpkgpm.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: dpkgpm.h,v 1.3 1999/01/31 08:49:39 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} 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. // The Actuall installation implementation
  31. virtual bool Install(PkgIterator Pkg,string File);
  32. virtual bool Configure(PkgIterator Pkg);
  33. virtual bool Remove(PkgIterator Pkg);
  34. virtual bool Go();
  35. public:
  36. pkgDPkgPM(pkgDepCache &Cache);
  37. virtual ~pkgDPkgPM();
  38. };
  39. #endif