diff options
author | jbj <devnull@localhost> | 2001-02-12 19:02:15 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-02-12 19:02:15 +0000 |
commit | 85a84a6826f982160c31286fb23be771d69eb5ea (patch) | |
tree | 3c7b44d9f713c7f61d3f8a0470c2cedd52c15f08 /python | |
parent | bc348ac49cddff43f7aed6d0d17531a8482d0e47 (diff) | |
download | librpm-tizen-85a84a6826f982160c31286fb23be771d69eb5ea.tar.gz librpm-tizen-85a84a6826f982160c31286fb23be771d69eb5ea.tar.bz2 librpm-tizen-85a84a6826f982160c31286fb23be771d69eb5ea.zip |
Add rpmRC return code type for the usual 0/1/2 codes.
Add RPMRC_BADSIZE to deal with packages changing size after repackaging.
CVS patchset: 4550
CVS date: 2001/02/12 19:02:15
Diffstat (limited to 'python')
-rw-r--r-- | python/rpmmodule.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c index aa8ef181c..c092ac6ae 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -1703,10 +1703,10 @@ static PyObject * rpmHeaderFromPackage(PyObject * self, PyObject * args) { hdrObject * h; Header header; Header sigs; - int rc; FD_t fd; int rawFd; int isSource = 0; + rpmRC rc; if (!PyArg_ParseTuple(args, "i", &rawFd)) return NULL; fd = fdDup(rawFd); @@ -1715,7 +1715,8 @@ static PyObject * rpmHeaderFromPackage(PyObject * self, PyObject * args) { Fclose(fd); switch (rc) { - case 0: + case RPMRC_BADSIZE: + case RPMRC_OK: h = (hdrObject *) PyObject_NEW(PyObject, &hdrType); h->h = header; h->sigs = sigs; @@ -1726,12 +1727,14 @@ static PyObject * rpmHeaderFromPackage(PyObject * self, PyObject * args) { isSource = 1; break; - case 1: + case RPMRC_BADMAGIC: Py_INCREF(Py_None); h = (hdrObject *) Py_None; break; - default: + case RPMRC_FAIL: + case RPMRC_SHORTREAD: + default: PyErr_SetString(pyrpmError, "error reading package"); return NULL; } |