dpkgpm.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: dpkgpm.h,v 1.8 2001/05/07 05:05:13 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. #include <stdio.h>
  16. using std::vector;
  17. class pkgDPkgPM : public pkgPackageManager
  18. {
  19. protected:
  20. struct Item
  21. {
  22. enum Ops {Install, Configure, Remove, Purge} Op;
  23. string File;
  24. PkgIterator Pkg;
  25. Item(Ops Op,PkgIterator Pkg,string File = "") : Op(Op),
  26. File(File), Pkg(Pkg) {};
  27. Item() {};
  28. };
  29. vector<Item> List;
  30. // Helpers
  31. bool RunScripts(const char *Cnf);
  32. bool RunScriptsWithPkgs(const char *Cnf);
  33. bool SendV2Pkgs(FILE *F);
  34. // The Actuall installation implementation
  35. virtual bool Install(PkgIterator Pkg,string File);
  36. virtual bool Configure(PkgIterator Pkg);
  37. virtual bool Remove(PkgIterator Pkg,bool Purge = false);
  38. virtual bool Go();
  39. virtual void Reset();
  40. public:
  41. pkgDPkgPM(pkgDepCache *Cache);
  42. virtual ~pkgDPkgPM();
  43. };
  44. #endif