#include <list>
#include <string>
+#include <vector>
#ifndef APT_8_CLEANER_HEADERS
#include <apt-pkg/depcache.h>
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
*
* \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
*
*
* \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
*
*
* \return true if universe was composed successfully, otherwise false
*/
+ bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output,
+ std::vector<bool> 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
*
* \return true if the request could be found and worked on, otherwise false
*/
bool ReadRequest(int const input, std::list<std::string> &install,
+ std::list<std::string> &remove, unsigned int &flags);
+ APT_DEPRECATED_MSG("use the flag-based version instead") bool ReadRequest(int const input, std::list<std::string> &install,
std::list<std::string> &remove, bool &upgrade,
bool &distUpgrade, bool &autoRemove);
*
* \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
*
* \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
*
* \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
*
* \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);
}