]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- python bindings: expose headers from spec file auto/th/rpm-5.4.15-33
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 11 May 2016 20:14:23 +0000 (22:14 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Wed, 11 May 2016 20:14:23 +0000 (22:14 +0200)
- rel 33

rpm-python-spec-header.patch [new file with mode: 0644]
rpm.spec

diff --git a/rpm-python-spec-header.patch b/rpm-python-spec-header.patch
new file mode 100644 (file)
index 0000000..d56b6b2
--- /dev/null
@@ -0,0 +1,56 @@
+diff -ur rpm-5.4.15/python/spec-py.c rpm-5.4.15-pyspec/python/spec-py.c
+--- rpm-5.4.15/python/spec-py.c        2016-05-11 21:38:24.970137574 +0200
++++ rpm-5.4.15-pyspec/python/spec-py.c 2016-05-10 22:47:04.748529737 +0200
+@@ -8,6 +8,9 @@
+ #include <rpmio.h>
+ #define _MACRO_INTERNAL
+ #include <rpmmacro.h>
++#define       _RPMTAG_INTERNAL
++#include "header_internal.h"  /* XXX HEADERFLAG_ALLOCATED */
++#include "header-py.h"
+ #include "spec-py.h"
+ /** \ingroup python
+@@ -192,6 +195,34 @@
+ }
++static PyObject *
++spec_get_headers(specObject *s)
++    /*@*/
++{
++    PyObject *headerList;
++    Spec spec;
++    Package package;
++    Header header;
++
++    headerList = PyList_New(0);
++    if (!headerList) {
++        return NULL;
++    }
++    spec = specFromSpec(s);
++    if ( spec != NULL) {
++        package = spec->packages;
++
++         while (package != NULL) {
++            header = package->header;
++          if (header != NULL)
++                PyList_Append(headerList, (PyObject *) hdr_Wrap(header));
++            package = package->next;
++        } 
++    }
++
++    return PyList_AsTuple(headerList);
++}
++
+ /**
+  */
+  /*@unchecked@*/ /*@observer@*/
+@@ -208,6 +239,7 @@
+     {"clean",   (PyCFunction) spec_get_clean, METH_VARARGS,  NULL },
+     {"buildRoot",   (PyCFunction) spec_get_buildroot, METH_VARARGS,  NULL },
+     {"macros",   (PyCFunction) spec_get_macros, METH_VARARGS,  NULL },
++    {"headers",   (PyCFunction) spec_get_headers, METH_VARARGS,  NULL },
+     {NULL}  /* Sentinel */
+ };
+ /*@=fullinitblock@*/
index a914ee6a0cee58ad3dc9e77630ddb300fbc54ac8..2d6d3bba1dc8e9c452c459e80c4842926908aa70 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -51,7 +51,7 @@ Summary(ru.UTF-8):    Менеджер пакетов от RPM
 Summary(uk.UTF-8):     Менеджер пакетів від RPM
 Name:          rpm
 Version:       5.4.15
-Release:       32
+Release:       33
 License:       LGPL v2.1
 Group:         Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm
@@ -181,6 +181,7 @@ Patch91:    py-disable-fetch.patch
 Patch92:       fast_python_deps.patch
 Patch93:       python2_explicit.patch
 Patch94:       do_not_write_before_macro_buffer.patch
+Patch95:       rpm-python-spec-header.patch
 
 # Patches imported from Mandriva
 
@@ -1020,6 +1021,7 @@ cd -
 %patch92 -p1
 %patch93 -p1
 %patch94 -p1
+%patch95 -p1
 
 %patch1050 -p1
 
This page took 0.081354 seconds and 4 git commands to generate.