diff options
-rw-r--r-- | python/rpmdb-py.c | 54 | ||||
-rw-r--r-- | python/rpmdb-py.h | 7 | ||||
-rw-r--r-- | python/rpmmodule.c | 6 |
3 files changed, 0 insertions, 67 deletions
diff --git a/python/rpmdb-py.c b/python/rpmdb-py.c index f120e2ada..44be4d594 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 0e6284e95..843ca008e 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 994e7e209..d0ea29b2d 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); |