dpkgpm.h 1.3 KB

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