return list;
}
-static PyObject* Request_solve(RequestObject* self) {
- int ret = pakfire_request_solve(self->request, 0);
+static PyObject* Request_solve(RequestObject* self, PyObject* args, PyObject *kwds) {
+ char* kwlist[] = {"without_recommends", NULL};
+
+ int without_recommends = 0;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|p", kwlist, &without_recommends))
+ return NULL;
+
+ int flags = 0;
+ if (without_recommends)
+ flags |= PAKFIRE_SOLVER_WITHOUT_RECOMMENDS;
+
+ int ret = pakfire_request_solve(self->request, flags);
// Raise a DependencyError with all problems
// if the request could not be solved
{
"solve",
(PyCFunction)Request_solve,
- METH_NOARGS,
+ METH_VARARGS|METH_KEYWORDS,
NULL
},
{ NULL }
};
enum _pakfire_solver_flags {
- PAKFIRE_SOLVER_ALLOW_UNINSTALL = 1 << 0,
- PAKFIRE_SOLVER_FORCE_BEST = 1 << 1,
+ PAKFIRE_SOLVER_ALLOW_UNINSTALL = 1 << 0,
+ PAKFIRE_SOLVER_FORCE_BEST = 1 << 1,
+ PAKFIRE_SOLVER_WITHOUT_RECOMMENDS = 1 << 2,
};
PakfireRequest pakfire_request_create(PakfirePool pool);
if (flags & PAKFIRE_SOLVER_ALLOW_UNINSTALL)
solver_set_flag(solver, SOLVER_FLAG_ALLOW_UNINSTALL, 1);
+ /* ignore recommends */
+ if (flags & PAKFIRE_SOLVER_WITHOUT_RECOMMENDS)
+ solver_set_flag(solver, SOLVER_FLAG_IGNORE_RECOMMENDED, 1);
+
/* no vendor locking */
solver_set_flag(solver, SOLVER_FLAG_ALLOW_VENDORCHANGE, 1);
def handle_install(self, ns):
with self.pakfire(ns) as p:
- p.install(ns.package, ignore_recommended=ns.without_recommends)
+ p.install(ns.package, without_recommends=ns.without_recommends)
def handle_reinstall(self, ns):
with self.pakfire(ns) as p: