X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/5dd00edbcf702cac1ea22392796c65881a8ef6f9..0cfec3ab589c6309bf284438d2148c7742cdaf10:/apt-pkg/edsp.h diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 2053e14e1..347304390 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -18,6 +18,7 @@ #include #include +#include #ifndef APT_8_CLEANER_HEADERS #include @@ -29,6 +30,16 @@ class OpProgress; namespace EDSP /*{{{*/ { + namespace Request + { + enum Flags + { + AUTOREMOVE = (1 << 0), /*!< removal of unneeded packages should be performed */ + UPGRADE_ALL = (1 << 1), /*!< upgrade all installed packages, like 'apt-get full-upgrade' without forbid flags */ + FORBID_NEW_INSTALL = (1 << 2), /*!< forbid the resolver to install new packages */ + FORBID_REMOVE = (1 << 3), /*!< forbid the resolver to remove packages */ + }; + } /** \brief creates the EDSP request stanza * * In the EDSP protocol the first thing send to the resolver is a stanza @@ -38,18 +49,19 @@ namespace EDSP /*{{{*/ * * \param Cache in which the request is encoded * \param output is written to this "file" - * \param upgrade is true if it is an request like apt-get upgrade - * \param distUpgrade is true if it is a request like apt-get dist-upgrade - * \param autoRemove is true if removal of unneeded packages should be performed + * \param flags effecting the request documented in #EDSP::Request::Flags * \param Progress is an instance to report progress to * * \return true if request was composed successfully, otherwise false */ + bool WriteRequest(pkgDepCache &Cache, FileFd &output, + unsigned int const flags = 0, + OpProgress *Progress = NULL); bool WriteRequest(pkgDepCache &Cache, FILE* output, bool const upgrade = false, bool const distUpgrade = false, bool const autoRemove = false, - OpProgress *Progress = NULL); + OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief creates the scenario representing the package universe * @@ -68,7 +80,8 @@ namespace EDSP /*{{{*/ * * \return true if universe was composed successfully, otherwise false */ - bool WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL); + bool WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress = NULL); + bool WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief creates a limited scenario representing the package universe * @@ -85,9 +98,12 @@ namespace EDSP /*{{{*/ * * \return true if universe was composed successfully, otherwise false */ + bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output, + std::vector const &pkgset, + OpProgress *Progress = NULL); bool WriteLimitedScenario(pkgDepCache &Cache, FILE* output, APT::PackageSet const &pkgset, - OpProgress *Progress = NULL); + OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief waits and acts on the information returned from the solver * @@ -121,6 +137,8 @@ namespace EDSP /*{{{*/ * \return true if the request could be found and worked on, otherwise false */ bool ReadRequest(int const input, std::list &install, + std::list &remove, unsigned int &flags); + APT_DEPRECATED_MSG("use the flag-based version instead") bool ReadRequest(int const input, std::list &install, std::list &remove, bool &upgrade, bool &distUpgrade, bool &autoRemove); @@ -152,7 +170,8 @@ namespace EDSP /*{{{*/ * * \return true if solution could be written, otherwise false */ - bool WriteSolution(pkgDepCache &Cache, FILE* output); + bool WriteSolution(pkgDepCache &Cache, FileFd &output); + bool WriteSolution(pkgDepCache &Cache, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief sends a progress report * @@ -160,7 +179,8 @@ namespace EDSP /*{{{*/ * \param message the solver wants the user to see * \param output the front-end listens for progress report */ - bool WriteProgress(unsigned short const percent, const char* const message, FILE* output); + bool WriteProgress(unsigned short const percent, const char* const message, FileFd &output); + bool WriteProgress(unsigned short const percent, const char* const message, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief sends an error report * @@ -177,7 +197,8 @@ namespace EDSP /*{{{*/ * \param message is free form text to describe the error * \param output the front-end listens for error messages */ - bool WriteError(char const * const uuid, std::string const &message, FILE* output); + bool WriteError(char const * const uuid, std::string const &message, FileFd &output); + bool WriteError(char const * const uuid, std::string const &message, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief executes the given solver and returns the pipe ends @@ -200,15 +221,16 @@ namespace EDSP /*{{{*/ * * \param solver to execute * \param Cache with the problem and as universe to work in - * \param upgrade is true if it is a request like apt-get upgrade - * \param distUpgrade is true if it is a request like apt-get dist-upgrade - * \param autoRemove is true if unneeded packages should be removed + * \param flags effecting the request documented in #EDSP::Request::Flags * \param Progress is an instance to report progress to * * \return true if the solver has successfully solved the problem, * otherwise false */ bool ResolveExternal(const char* const solver, pkgDepCache &Cache, + unsigned int const flags = 0, + OpProgress *Progress = NULL); + APT_DEPRECATED_MSG("use the flag-based version instead") bool ResolveExternal(const char* const solver, pkgDepCache &Cache, bool const upgrade, bool const distUpgrade, bool const autoRemove, OpProgress *Progress = NULL); }