summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-23 10:11:45 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-23 10:11:45 +0300
commitc21a1ea23db40bd136a859eb171a49ae51e25c64 (patch)
tree3fde3fa9a6d33b903b95c5fdc861b5983a2c7f98
parentd38f0eb5422252c4750eac421f0fb8c7c8d43a16 (diff)
downloadrpm-c21a1ea23db40bd136a859eb171a49ae51e25c64.tar.gz
rpm-c21a1ea23db40bd136a859eb171a49ae51e25c64.tar.bz2
rpm-c21a1ea23db40bd136a859eb171a49ae51e25c64.zip
Deprecate rpm.headerLoad()
- this is not needed now, just call rpm.hdr(<blob) to load
-rw-r--r--python/header-py.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/python/header-py.c b/python/header-py.c
index b8943a0eb..821d1f9c9 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -329,6 +329,7 @@ static struct PyMethodDef hdr_methods[] = {
{NULL, NULL} /* sentinel */
};
+/* TODO: permit keyring check + retrofits on copy/load */
static PyObject *hdr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
PyObject *obj = NULL;
@@ -580,29 +581,10 @@ Header hdrGetHeader(hdrObject * s)
return s->h;
}
-PyObject * hdrLoad(PyObject * self, PyObject * args, PyObject * kwds)
+PyObject * hdrLoad(PyObject * s, PyObject * args, PyObject * kwds)
{
- PyObject * hdr;
- char * obj;
- Header h;
- int len;
- char * kwlist[] = {"headers", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", kwlist, &obj, &len))
- return NULL;
-
- /* copy is needed to avoid surprises from data swab in headerLoad(). */
- h = headerCopyLoad(obj);
- if (!h) {
- PyErr_SetString(pyrpmError, "bad header");
- return NULL;
- }
- headerConvert(h, HEADERCONV_RETROFIT_V3);
-
- hdr = hdr_Wrap(h);
- h = headerFree(h); /* XXX ref held by hdr */
-
- return hdr;
+ DEPRECATED_METHOD;
+ return PyObject_Call((PyObject *) &hdr_Type, args, kwds);
}
PyObject * rpmReadHeaders (FD_t fd)