[python-pycurl/f17] add the GLOBAL_ACK_EINTR constant to the list of exported symbols (#920589)

Kamil Dudka kdudka at fedoraproject.org
Tue Apr 9 14:13:32 UTC 2013


commit ba831b64a0f9ef3425f5840f40db0d8f4ab7b160
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Tue Apr 9 16:08:42 2013 +0200

    add the GLOBAL_ACK_EINTR constant to the list of exported symbols (#920589)

 ...BAL_ACK_EINTR-constant-to-the-list-of-exp.patch |   61 ++++++++++++++++++++
 python-pycurl.spec                                 |   10 +++-
 2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/0105-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch b/0105-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch
new file mode 100644
index 0000000..2731893
--- /dev/null
+++ b/0105-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch
@@ -0,0 +1,61 @@
+From cf4104369f5716a6904152435713ec81358c0102 Mon Sep 17 00:00:00 2001
+From: Zdenek Pavlas <zpavlas at redhat.com>
+Date: Wed, 13 Mar 2013 16:55:58 +0100
+Subject: [PATCH] add the GLOBAL_ACK_EINTR constant to the list of exported symbols
+
+... if built against a new enough version of libcurl
+
+Bug: https://bugzilla.redhat.com/920589
+
+Signed-off-by: Kamil Dudka <kdudka at redhat.com>
+---
+ src/pycurl.c |   19 +++++++++++++++----
+ 1 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/src/pycurl.c b/src/pycurl.c
+index b59eeb8..9a7135c 100644
+--- a/src/pycurl.c
++++ b/src/pycurl.c
+@@ -3125,6 +3125,16 @@ static PyTypeObject CurlMulti_Type = {
+      */
+ };
+ 
++static int
++are_global_init_flags_valid(int flags)
++{
++#ifdef CURL_GLOBAL_ACK_EINTR
++    /* CURL_GLOBAL_ACK_EINTR was introduced in libcurl-7.30.0 */
++    return !(flags & ~(CURL_GLOBAL_ALL | CURL_GLOBAL_ACK_EINTR));
++#else
++    return !(flags & ~(CURL_GLOBAL_ALL));
++#endif
++}
+ 
+ /*************************************************************************
+ // module level
+@@ -3142,10 +3152,7 @@ do_global_init(PyObject *dummy, PyObject *args)
+         return NULL;
+     }
+ 
+-    if (!(option == CURL_GLOBAL_SSL ||
+-          option == CURL_GLOBAL_WIN32 ||
+-          option == CURL_GLOBAL_ALL ||
+-          option == CURL_GLOBAL_NOTHING)) {
++    if (!are_global_init_flags_valid(option)) {
+         PyErr_SetString(PyExc_ValueError, "invalid option to global_init");
+         return NULL;
+     }
+@@ -3780,6 +3787,10 @@ initpycurl(void)
+     insint(d, "GLOBAL_ALL", CURL_GLOBAL_ALL);
+     insint(d, "GLOBAL_NOTHING", CURL_GLOBAL_NOTHING);
+     insint(d, "GLOBAL_DEFAULT", CURL_GLOBAL_DEFAULT);
++#ifdef CURL_GLOBAL_ACK_EINTR
++    /* CURL_GLOBAL_ACK_EINTR was introduced in libcurl-7.30.0 */
++    insint(d, "GLOBAL_ACK_EINTR", CURL_GLOBAL_ACK_EINTR);
++#endif
+ 
+ 
+     /* constants for curl_multi_socket interface */
+-- 
+1.7.1
+
diff --git a/python-pycurl.spec b/python-pycurl.spec
index a4fb846..ce721c6 100644
--- a/python-pycurl.spec
+++ b/python-pycurl.spec
@@ -2,7 +2,7 @@
 
 Name:           python-pycurl
 Version:        7.19.0
-Release:        11%{?dist}
+Release:        11.1%{?dist}
 Summary:        A Python interface to libcurl
 
 Group:          Development/Languages
@@ -13,6 +13,10 @@ Patch0:         python-pycurl-no-static-libs.patch
 Patch1:         python-pycurl-fix-do_curl_reset-refcount.patch
 Patch3:         0003-Fixes-refcount-bug-and-provides-better-organization-.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+# bz #920589 - add the GLOBAL_ACK_EINTR constant to the list of exported symbols
+Patch105:       0105-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch
+
 Requires:       keyutils-libs
 
 BuildRequires:  python-devel
@@ -42,6 +46,7 @@ of features.
 %patch3 -p1
 %patch0 -p0
 %patch1 -p1
+%patch105 -p1
 chmod a-x examples/*
 
 %build
@@ -65,6 +70,9 @@ rm -rf %{buildroot}
 %{python_sitearch}/*
 
 %changelog
+* Tue Apr 09 2013 Kamil Dudka <kdudka at redhat.com> - 7.19.0-11.1
+- add the GLOBAL_ACK_EINTR constant to the list of exported symbols (#920589)
+
 * Tue Feb 26 2013 Kamil Dudka <kdudka at redhat.com> - 7.19.0-11
 - reinitialize pycurl-specific defaults in reset() (#896025)
 


More information about the scm-commits mailing list