return NULL;
}
+static PyObject* Transaction_run(TransactionObject* self) {
+ char* problems = NULL;
+ int r;
+
+ // Run the transaction
+ r = pakfire_transaction_run(self->transaction);
+ if (r < 0) {
+ errno = -r;
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto ERROR;
+
+ // Solving failed :(
+ } else if (r > 0) {
+ PyErr_SetString(PyExc_DependencyError, problems);
+ goto ERROR;
+ }
+
+ // Problems should never be set here
+ assert(problems == NULL);
+
+ // Return None if everything was okay
+ Py_RETURN_NONE;
+
+ERROR:
+ if (problems)
+ free(problems);
+
+ return NULL;
+}
+
static struct PyMethodDef Transaction_methods[] = {
{
"install",
METH_VARARGS|METH_KEYWORDS,
NULL,
},
+ {
+ "run",
+ (PyCFunction)Transaction_run,
+ METH_NOARGS,
+ NULL,
+ },
{
"solve",
(PyCFunction)Transaction_solve,