AM_CPPFLAGS += -I$(top_srcdir)/misc
AM_CPPFLAGS += -I@WITH_PYTHON_INCLUDE@
-pkgpyexec_LTLIBRARIES = _rpmmodule.la
+pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la
pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py
_rpmmodule_la_LDFLAGS = -module -avoid-version
_rpmmodule_la_LIBADD = \
- $(top_builddir)/build/librpmbuild.la \
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmio/librpmio.la \
@WITH_PYTHON_LIB@
rpmmacro-py.c rpmmacro-py.h \
rpmtd-py.c rpmtd-py.h \
rpmte-py.c rpmte-py.h \
- rpmts-py.c rpmts-py.h \
+ rpmts-py.c rpmts-py.h
+
+_rpmbmodule_la_LDFLAGS = -module -avoid-version
+_rpmbmodule_la_LIBADD = \
+ $(top_builddir)/build/librpmbuild.la \
+ $(top_builddir)/lib/librpm.la \
+ $(top_builddir)/rpmio/librpmio.la \
+ @WITH_PYTHON_LIB@
+
+_rpmbmodule_la_SOURCES = rpmbmodule.c rpmsystem-py.h \
spec-py.c spec-py.h
endif
_RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD
_RPMVSF_NOSIGNATURES = _rpm._RPMVSF_NOSIGNATURES
+# try to import build bits but dont require it
+try:
+ from _rpmb import *
+except ImportError:
+ pass
+
# backwards compatibility + give the same class both ways
ts = TransactionSet
def setProbFilter(self, ignoreSet):
return _wrapSetGet('_probFilter', ignoreSet)
+ def parseSpec(self, specfile):
+ import _rpmb
+ return _rpmb.spec(specfile)
#include "rpmtd-py.h"
#include "rpmte-py.h"
#include "rpmts-py.h"
-#include "spec-py.h"
#include "debug.h"
if (PyType_Ready(&rpmtd_Type) < 0) return;
if (PyType_Ready(&rpmte_Type) < 0) return;
if (PyType_Ready(&rpmts_Type) < 0) return;
- if (PyType_Ready(&spec_Type) < 0) return;
m = Py_InitModule3("_rpm", rpmModuleMethods, rpm__doc__);
if (m == NULL)
Py_INCREF(&rpmts_Type);
PyModule_AddObject(m, "ts", (PyObject *) &rpmts_Type);
- Py_INCREF(&spec_Type);
- PyModule_AddObject(m, "spec", (PyObject *) &spec_Type);
-
addRpmTags(m);
#define REGISTER_ENUM(val) PyModule_AddIntConstant(m, #val, val)
#include "rpmmi-py.h"
#include "rpmps-py.h"
#include "rpmte-py.h"
-#include "spec-py.h"
#include "rpmts-py.h"
}
static PyObject *
-spec_Parse(rpmtsObject * s, PyObject * args, PyObject * kwds)
-{
- DEPRECATED_METHOD("use 'spec = rpm.spec(<specfile>)' instead");
- /* we could pass in the ts from here but hardly worth the trouble */
- return PyObject_Call((PyObject *) &spec_Type, args, kwds);
-}
-
-static PyObject *
rpmts_Match(rpmtsObject * s, PyObject * args, PyObject * kwds)
{
PyObject *Key = NULL;
NULL },
{"getKeys", (PyCFunction) rpmts_GetKeys, METH_NOARGS,
NULL },
- {"parseSpec", (PyCFunction) spec_Parse, METH_VARARGS|METH_KEYWORDS,
-"ts.parseSpec(\"/path/to/foo.spec\") -> spec\n\
-- Parse a spec file.\n" },
{"dbMatch", (PyCFunction) rpmts_Match, METH_VARARGS|METH_KEYWORDS,
"ts.dbMatch([TagN, [key, [len]]]) -> mi\n\
- Create a match iterator for the default transaction rpmdb.\n" },
cookie, anyarch, force) == 0) {
spec = rpmtsSpec(ts);
} else {
- PyErr_SetString(pyrpmError, "can't parse specfile\n");
+ PyErr_SetString(pyrpmbError, "can't parse specfile\n");
}
rpmtsFree(ts);
extern PyTypeObject spec_Type;
+extern PyObject *pyrpmbError;
+
#define specObject_Check(v) ((v)->ob_type == &spec_Type)
rpmSpec specFromSpec(specObject * spec);