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

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


commit 30d0e5c7216a0f1e6f76cf9ef597c1a84f036583
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Tue Apr 9 16:04:30 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                                 |    7 ++-
 2 files changed, 67 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 ca7c90d..a5e0c55 100644
--- a/python-pycurl.spec
+++ b/python-pycurl.spec
@@ -2,7 +2,7 @@
 
 Name:           python-pycurl
 Version:        7.19.0
-Release:        15%{?dist}
+Release:        15.1%{?dist}
 Summary:        A Python interface to libcurl
 
 Group:          Development/Languages
@@ -22,6 +22,7 @@ Patch101:       0101-test_internals.py-add-a-test-for-ref-counting-of-res.patch
 Patch102:       0102-pycurl.c-eliminate-duplicated-code-in-util_write_cal.patch
 Patch103:       0103-pycurl.c-allow-to-return-1-from-write-callback.patch
 Patch104:       0104-test_write_abort.py-test-returning-1-from-write-call.patch
+Patch105:       0105-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch
 
 Requires:       keyutils-libs
 BuildRequires:  python-devel
@@ -57,6 +58,7 @@ of features.
 %patch102 -p1
 %patch103 -p1
 %patch104 -p1
+%patch105 -p1
 chmod a-x examples/*
 
 %build
@@ -75,6 +77,9 @@ rm -rf %{buildroot}%{_datadir}/doc/pycurl
 %{python_sitearch}/*
 
 %changelog
+* Tue Apr 09 2013 Kamil Dudka <kdudka at redhat.com> - 7.19.0-15.1
+- add the GLOBAL_ACK_EINTR constant to the list of exported symbols (#920589)
+
 * Wed Mar 06 2013 Kamil Dudka <kdudka at redhat.com> - 7.19.0-15
 - allow to return -1 from the write callback (#857875) 
 - remove the patch for curl-config --static-libs no longer needed


More information about the scm-commits mailing list