diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-05 12:09:26 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-05 12:09:26 +0300 |
commit | 44ee4e164e340c0d4e4725cc57811ce637deaef3 (patch) | |
tree | 750dc56935ff94ee6856f98d20b63c85d9625f96 /python/rpmts-py.c | |
parent | a15bfa40adc826dfa91f9bdc24b3e680cd8aecb6 (diff) | |
download | librpm-tizen-44ee4e164e340c0d4e4725cc57811ce637deaef3.tar.gz librpm-tizen-44ee4e164e340c0d4e4725cc57811ce637deaef3.tar.bz2 librpm-tizen-44ee4e164e340c0d4e4725cc57811ce637deaef3.zip |
Push the interpretation of ts.run() result code to python side
- at least this lets sub-typers override the hysterical return values
Diffstat (limited to 'python/rpmts-py.c')
-rw-r--r-- | python/rpmts-py.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 576de02b1..ab83321a8 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -590,9 +590,6 @@ static PyObject * rpmts_Run(rpmtsObject * s, PyObject * args, PyObject * kwds) { int rc; - PyObject * list; - rpmps ps; - rpmpsi psi; struct rpmtsCallbackType_s cbInfo; char * kwlist[] = {"callback", "data", NULL}; @@ -612,38 +609,13 @@ rpmts_Run(rpmtsObject * s, PyObject * args, PyObject * kwds) } rc = rpmtsRun(s->ts, NULL, s->ignoreSet); - ps = rpmtsProblems(s->ts); if (cbInfo.cb) (void) rpmtsSetNotifyCallback(s->ts, NULL, NULL); PyEval_RestoreThread(cbInfo._save); - if (rc < 0) { - list = PyList_New(0); - return list; - } else if (!rc) { - Py_RETURN_NONE; - } - - list = PyList_New(0); - psi = rpmpsInitIterator(ps); - while (rpmpsNextIterator(psi) >= 0) { - rpmProblem p = rpmpsGetProblem(psi); - char * ps = rpmProblemString(p); - PyObject * prob = Py_BuildValue("s(isN)", ps, - rpmProblemGetType(p), - rpmProblemGetStr(p), - PyLong_FromLongLong(rpmProblemGetDiskNeed(p))); - PyList_Append(list, prob); - free(ps); - Py_DECREF(prob); - } - - psi = rpmpsFreeIterator(psi); - ps = rpmpsFree(ps); - - return list; + return Py_BuildValue("i", rc); } static PyObject * |