return Request_operation_return(ret);
}
+static PyObject* Request_verify(RequestObject* self) {
+ int ret = pakfire_request_verify(self->request);
+
+ return Request_operation_return(ret);
+}
+
static PyObject* Request_get_problems(RequestObject* self) {
PyObject* list = PyList_New(0);
METH_NOARGS,
NULL
},
+ {
+ "verify",
+ (PyCFunction)Request_verify,
+ METH_NOARGS,
+ NULL
+ },
{
"solve",
(PyCFunction)Request_solve,
"""
return self.pakfire.repos
- def check(self, allow_downgrade=True, allow_uninstall=True):
+ def check(self, **kwargs):
"""
Try to fix any errors in the system.
"""
# Detect any errors in the dependency tree.
# For that we create an empty request and solver and try to solve
# something.
- request = self.pakfire.pool.create_request()
+ request = _pakfire.Request(self.pakfire.pool)
request.verify()
- solver = self.pakfire.pool.solve(
- request,
- allow_downgrade=allow_downgrade,
- allow_uninstall=allow_uninstall,
- )
-
- if solver.status is False:
- log.info(_("Everything is fine."))
- return
-
- # Create the transaction.
- t = transaction.Transaction.from_solver(self.pakfire, solver)
- t.dump()
-
- # Ask the user if okay.
- if not t.cli_yesno():
- return
-
- # Process the transaction.
- t.run()
+ return request.solve(**kwargs)
def info(self, patterns):
pkgs = []
def handle_check(self, ns):
with self.pakfire(ns) as p:
- p.check()
+ # This will throw an exception when there are errors
+ transaction = p.check()
+
+ self.ui.message(_("Everything okay"))
def handle_resolvdep(self, ns):
with self.pakfire(ns) as p: