summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-02 15:21:20 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-02 15:24:32 +0300
commit8f642cba13bf1e1e935a29a663b8ecb13ae6e7ac (patch)
treeb36f608979b7a5412810c7604b586cf975b200a8 /python
parent4a374712c7d07143d30d1772657a476b3cfa5a75 (diff)
downloadlibrpm-tizen-8f642cba13bf1e1e935a29a663b8ecb13ae6e7ac.tar.gz
librpm-tizen-8f642cba13bf1e1e935a29a663b8ecb13ae6e7ac.tar.bz2
librpm-tizen-8f642cba13bf1e1e935a29a663b8ecb13ae6e7ac.zip
Add an experimental low-level build method to python spec
- This is mostly just a toy for now, but serves as a kind of yardstick for what is missing in librpmbuild to be generally useful for building stuff.
Diffstat (limited to 'python')
-rw-r--r--python/spec-py.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/python/spec-py.c b/python/spec-py.c
index 1377a7863..63c3aa80d 100644
--- a/python/spec-py.c
+++ b/python/spec-py.c
@@ -232,6 +232,23 @@ static PyObject *spec_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
return spec_Wrap(subtype, spec);
}
+static PyObject * spec_doBuild(specObject *self, PyObject *args, PyObject *kwds)
+{
+ char * kwlist[] = { "buildAmount", "pkgFlags", NULL };
+ struct rpmBuildArguments_s ba = { 0 };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "i|i:spec_doBuild",
+ kwlist, &ba.buildAmount, &ba.pkgFlags))
+ return NULL;
+
+ return PyBool_FromLong(rpmSpecBuild(self->spec, &ba) == RPMRC_OK);
+}
+
+static struct PyMethodDef spec_methods[] = {
+ { "_doBuild", (PyCFunction)spec_doBuild, METH_VARARGS|METH_KEYWORDS, NULL },
+ { NULL, NULL }
+};
+
PyTypeObject spec_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"rpm.spec", /*tp_name*/
@@ -260,7 +277,7 @@ PyTypeObject spec_Type = {
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
- 0, /* tp_methods */
+ spec_methods, /* tp_methods */
0, /* tp_members */
spec_getseters, /* tp_getset */
0, /* tp_base */