diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-06-16 08:48:57 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-06-16 08:55:10 +0300 |
commit | a324a53527e4ecacabc33a73cfcb4c572aaefa2d (patch) | |
tree | c5867171d35282c436c132a56c63afe53f5fd127 /python | |
parent | 2f6bfc99d01df941f6aaad8497150f82eeb75311 (diff) | |
download | librpm-tizen-a324a53527e4ecacabc33a73cfcb4c572aaefa2d.tar.gz librpm-tizen-a324a53527e4ecacabc33a73cfcb4c572aaefa2d.tar.bz2 librpm-tizen-a324a53527e4ecacabc33a73cfcb4c572aaefa2d.zip |
Export rpmteFailed() to python bindings
- Kinda related to RhBug:661962, yum relies on callbacks to catch
install/erase errors but this is not accurate: on erase the
element can be ambiguous as the callback only gives a name (sigh).
In addition, elements can be skipped entirely if "parent" element
fails, in which case no callbacks are issued so these cases would go
completely unnoticed when relying on callbacks alone. te.Failed()
gives users such as yum a chance to have a look at the real status
of elements (after the transaction).
Diffstat (limited to 'python')
-rw-r--r-- | python/rpmte-py.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/rpmte-py.c b/python/rpmte-py.c index bd6601c34..73006e3e0 100644 --- a/python/rpmte-py.c +++ b/python/rpmte-py.c @@ -117,6 +117,11 @@ rpmte_Parent(rpmteObject * s) return Py_BuildValue("i", rpmteParent(s->te)); } +static PyObject * rpmte_Failed(rpmteObject * s) +{ + return Py_BuildValue("i", rpmteFailed(s->te)); +} + static PyObject * rpmte_Problems(rpmteObject * s) { rpmps ps = rpmteProblems(s->te); @@ -222,6 +227,8 @@ static struct PyMethodDef rpmte_methods[] = { NULL}, */ {"DBOffset",(PyCFunction)rpmte_DBOffset, METH_NOARGS, NULL}, + {"Failed", (PyCFunction)rpmte_Failed, METH_NOARGS, + NULL}, {"Key", (PyCFunction)rpmte_Key, METH_NOARGS, NULL}, {"DS", (PyCFunction)rpmte_DS, METH_VARARGS|METH_KEYWORDS, |