From: Panu Matilainen Date: Tue, 22 Sep 2009 13:24:32 +0000 (+0300) Subject: Kick out mummified rpmdb python interface remnants X-Git-Tag: rpm-4.8.0-beta1~242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd5cfeec61eeddedc842aa11d7ba2376c0e9411e;p=platform%2Fupstream%2Frpm.git Kick out mummified rpmdb python interface remnants --- diff --git a/python/rpmdb-py.c b/python/rpmdb-py.c index f120e2a..44be4d5 100644 --- a/python/rpmdb-py.c +++ b/python/rpmdb-py.c @@ -259,57 +259,3 @@ PyTypeObject rpmdb_Type = { #endif }; -#ifdef _LEGACY_BINDINGS_TOO -rpmdb dbFromDb(rpmdbObject * db) -{ - return db->db; -} - -/** - */ -rpmdbObject * -rpmOpenDB(PyObject * self, PyObject * args, PyObject * kwds) { - rpmdbObject * o; - char * root = ""; - int forWrite = 0; - char * kwlist[] = {"forWrite", "rootdir", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|is", kwlist, - &forWrite, &root)) - return NULL; - - o = PyObject_New(rpmdbObject, &rpmdb_Type); - o->db = NULL; - - if (rpmdbOpen(root, &o->db, forWrite ? O_RDWR | O_CREAT: O_RDONLY, 0644)) { - char * errmsg = "cannot open database in %s"; - char * errstr = NULL; - int errsize; - - Py_DECREF(o); - /* PyErr_SetString should take varargs... */ - rasprintf(&errstr, errmsg, *root == '\0' ? "/var/lib/rpm" : root); - PyErr_SetString(pyrpmError, errstr); - free(errstr); - return NULL; - } - - return o; -} - -/** - * @todo Permit header checks when doing --rebuilddb. - */ -PyObject * -rebuildDB (PyObject * self, PyObject * args, PyObject * kwds) -{ - char * rootDir = ""; - char * kwlist[] = {"rootdir", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &rootDir)) - return NULL; - - return Py_BuildValue("i", rpmdbRebuild(rootDir, NULL, NULL)); -} -#endif - diff --git a/python/rpmdb-py.h b/python/rpmdb-py.h index 0e6284e..843ca00 100644 --- a/python/rpmdb-py.h +++ b/python/rpmdb-py.h @@ -24,11 +24,4 @@ struct rpmdbObject_s { extern PyTypeObject rpmdb_Type; -#ifdef _LEGACY_BINDINGS_TOO -rpmdb dbFromDb(rpmdbObject * db); - -rpmdbObject * rpmOpenDB(PyObject * self, PyObject * args, PyObject * kwds); -PyObject * rebuildDB (PyObject * self, PyObject * args, PyObject * kwds); -#endif - #endif diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 994e7e2..d0ea29b 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -262,15 +262,9 @@ void init_rpm(void) d = PyModule_GetDict(m); -#ifdef HACK - pyrpmError = PyString_FromString("_rpm.error"); - PyDict_SetItemString(d, "error", pyrpmError); - Py_DECREF(pyrpmError); -#else pyrpmError = PyErr_NewException("_rpm.error", NULL, NULL); if (pyrpmError != NULL) PyDict_SetItemString(d, "error", pyrpmError); -#endif #if Py_TPFLAGS_HAVE_ITER /* XXX backport to python-1.5.2 */ Py_INCREF(&hdr_Type);