SHA256
3
0
forked from pool/rpm
Michael Schröder 2012-08-28 13:33:20 +00:00 committed by Git OBS Bridge
parent dd97e85fdf
commit f6f2b78e07
5 changed files with 3 additions and 56 deletions

View File

@ -1,43 +0,0 @@
--- python/header-py.c.orig 2012-04-23 09:13:33.000000000 +0000
+++ python/header-py.c 2012-04-23 09:14:25.000000000 +0000
@@ -368,8 +368,8 @@ static PyObject *hdr_new(PyTypeObject *s
if (obj == NULL) {
h = headerNew();
- } else if (PyCObject_Check(obj)) {
- h = PyCObject_AsVoidPtr(obj);
+ } else if (CAPSULE_CHECK(obj)) {
+ h = CAPSULE_EXTRACT(obj, "rpm._C_Header");
} else if (hdrObject_Check(obj)) {
h = headerCopy(((hdrObject*) obj)->h);
} else if (PyBytes_Check(obj)) {
--- python/rpmsystem-py.h.orig 2012-04-23 09:12:49.000000000 +0000
+++ python/rpmsystem-py.h 2012-04-23 09:13:19.000000000 +0000
@@ -33,6 +33,16 @@ typedef Py_ssize_t (*lenfunc)(PyObject *
#define PyBytes_AsString PyString_AsString
#endif
+#if ((PY_MAJOR_VERSION << 8) | (PY_MINOR_VERSION << 0)) >= 0x0207
+#define CAPSULE_BUILD(ptr,name) PyCapsule_New(ptr, name, NULL)
+#define CAPSULE_CHECK(obj) PyCapsule_CheckExact(obj)
+#define CAPSULE_EXTRACT(obj,name) PyCapsule_GetPointer(obj, name)
+#else
+#define CAPSULE_BUILD(ptr,name) PyCObject_FromVoidPtr(ptr, NULL)
+#define CAPSULE_CHECK(obj) PyCObject_Check(obj)
+#define CAPSULE_EXTRACT(obj,name) PyCObject_AsVoidPtr(obj)
+#endif
+
/* For Python 3, use the PyLong type throughout in place of PyInt */
#if PY_MAJOR_VERSION >= 3
#define PyInt_Check PyLong_Check
--- python/spec-py.c.orig 2012-04-23 09:13:41.000000000 +0000
+++ python/spec-py.c 2012-04-23 09:14:56.000000000 +0000
@@ -34,7 +34,7 @@ static PyObject *makeHeader(Header h)
PyObject *rpmmod = PyImport_ImportModuleNoBlock("rpm");
if (rpmmod == NULL) return NULL;
- PyObject *ptr = PyCObject_FromVoidPtr(h, NULL);
+ PyObject *ptr = CAPSULE_BUILD(h, "rpm._C_Header");
PyObject *hdr = PyObject_CallMethod(rpmmod, "hdr", "(O)", ptr);
Py_XDECREF(ptr);
Py_XDECREF(rpmmod);

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python3-rpm
Version: 4.9.1.2
Release: 0

View File

@ -1,13 +0,0 @@
--- scripts/brp-python-hardlink.orig 2012-04-18 13:33:39.000000000 +0000
+++ scripts/brp-python-hardlink 2012-04-18 13:34:52.000000000 +0000
@@ -10,8 +10,8 @@ fi
find "$RPM_BUILD_ROOT" -type f -name "*.pyc" | while read pyc ; do
pyo="${pyc%c}o"
if [ -f "$pyo" ] ; then
- csha="$(sha1sum -b $pyc | cut -d' ' -f 1)" && \
- osha="$(sha1sum -b $pyo | cut -d' ' -f 1)" && \
+ csha="$(sha1sum -b "$pyc" | cut -d' ' -f 1)" && \
+ osha="$(sha1sum -b "$pyo" | cut -d' ' -f 1)" && \
if [ "$csha" = "$osha" ] ; then
ln -f "$pyc" "$pyo"
fi

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rpm-python
Version: 4.10.0
Release: 0

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rpm
BuildRequires: binutils
BuildRequires: bzip2