[csw-devel] SF.net SVN: gar:[16443] csw/mgar/pkg/lang-python/pycurl/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Fri Dec 9 15:22:32 CET 2011


Revision: 16443
          http://gar.svn.sourceforge.net/gar/?rev=16443&view=rev
Author:   dmichelsen
Date:     2011-12-09 14:22:32 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
lang-python/pycurl/trunk: Patch to latest fixpack from OpenSolaris

Modified Paths:
--------------
    csw/mgar/pkg/lang-python/pycurl/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/lang-python/pycurl/trunk/files/pycurl-mondo.patch

Removed Paths:
-------------
    csw/mgar/pkg/lang-python/pycurl/trunk/files/remove-static-libs.patch

Modified: csw/mgar/pkg/lang-python/pycurl/trunk/Makefile
===================================================================
--- csw/mgar/pkg/lang-python/pycurl/trunk/Makefile	2011-12-09 13:27:28 UTC (rev 16442)
+++ csw/mgar/pkg/lang-python/pycurl/trunk/Makefile	2011-12-09 14:22:32 UTC (rev 16443)
@@ -11,9 +11,13 @@
 endef
 
 MASTER_SITES = http://pycurl.sourceforge.net/download/
+MASTER_SITES += http://src.opensolaris.org/source/raw/userland/src/components/python/pycurl/patches/
 DISTFILES += $(DISTNAME).tar.gz
-PATCHFILES += remove-static-libs.patch
 
+# Taken from http://src.opensolaris.org/source/xref/userland/src/components/python/pycurl/patches/pycurl-mondo.patch
+PATCHFILES += pycurl-mondo.patch
+PATCHDIRLEVEL = 0
+
 VENDOR_URL = http://pycurl.sourceforge.net/
 
 PACKAGES += CSWpy-curl

Added: csw/mgar/pkg/lang-python/pycurl/trunk/files/pycurl-mondo.patch
===================================================================
--- csw/mgar/pkg/lang-python/pycurl/trunk/files/pycurl-mondo.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/pycurl/trunk/files/pycurl-mondo.patch	2011-12-09 14:22:32 UTC (rev 16443)
@@ -0,0 +1,196 @@
+--- setup.py.orig	Fri Aug 07 15:00:51 2009 -0700
++++ setup.py	Tue Sep 21 10:59:03 2010 -0700
+@@ -97,8 +97,7 @@
+         else:
+             extra_compile_args.append(e)
+     libs = split_quoted(
+-        os.popen("'%s' --libs" % CURL_CONFIG).read()+\
+-        os.popen("'%s' --static-libs" % CURL_CONFIG).read())
++        os.popen("'%s' --libs" % CURL_CONFIG).read())
+     for e in libs:
+         if e[:2] == "-l":
+             libraries.append(e[2:])
+
+--- src/pycurl.c.orig	Fri Aug 07 15:00:51 2009 -0700
++++ src/pycurl.c	Tue Sep 21 10:59:03 2010 -0700
+@@ -747,6 +747,59 @@
+     return self;
+ }
+ 
++/* initializer - used to intialize curl easy handles for use with pycurl */
++static int
++util_curl_init(CurlObject *self)
++{
++    int res;
++    char *s = NULL;
++
++    /* Set curl error buffer and zero it */
++    res = curl_easy_setopt(self->handle, CURLOPT_ERRORBUFFER, self->error);
++    if (res != CURLE_OK) {
++        return (-1);
++    }
++    memset(self->error, 0, sizeof(self->error));
++
++    /* Set backreference */
++    res = curl_easy_setopt(self->handle, CURLOPT_PRIVATE, (char *) self);
++    if (res != CURLE_OK) {
++        return (-1);
++    }
++
++    /* Enable NOPROGRESS by default, i.e. no progress output */
++    res = curl_easy_setopt(self->handle, CURLOPT_NOPROGRESS, (long)1);
++    if (res != CURLE_OK) {
++        return (-1);
++    }
++
++    /* Disable VERBOSE by default, i.e. no verbose output */
++    res = curl_easy_setopt(self->handle, CURLOPT_VERBOSE, (long)0);
++    if (res != CURLE_OK) {
++        return (-1);
++    }
++
++    /* Set FTP_ACCOUNT to NULL by default */
++    res = curl_easy_setopt(self->handle, CURLOPT_FTP_ACCOUNT, NULL);
++    if (res != CURLE_OK) {
++        return (-1);
++    }
++
++    /* Set default USERAGENT */
++    s = (char *) malloc(7 + strlen(LIBCURL_VERSION) + 1);
++    if (s == NULL) {
++        return (-1);
++    }
++    strcpy(s, "PycURL/"); strcpy(s+7, LIBCURL_VERSION);
++    res = curl_easy_setopt(self->handle, CURLOPT_USERAGENT, (char *) s);
++    if (res != CURLE_OK) {
++        free(s);
++        return (-1);
++    }
++    self->options[ OPT_INDEX(CURLOPT_USERAGENT) ] = s; s = NULL;
++
++    return (0);
++}
+ 
+ /* constructor - this is a module-level function returning a new instance */
+ static CurlObject *
+@@ -754,7 +807,6 @@
+ {
+     CurlObject *self = NULL;
+     int res;
+-    char *s = NULL;
+ 
+     UNUSED(dummy);
+ 
+@@ -768,44 +820,9 @@
+     if (self->handle == NULL)
+         goto error;
+ 
+-    /* Set curl error buffer and zero it */
+-    res = curl_easy_setopt(self->handle, CURLOPT_ERRORBUFFER, self->error);
+-    if (res != CURLE_OK)
+-        goto error;
+-    memset(self->error, 0, sizeof(self->error));
+-
+-    /* Set backreference */
+-    res = curl_easy_setopt(self->handle, CURLOPT_PRIVATE, (char *) self);
+-    if (res != CURLE_OK)
+-        goto error;
+-
+-    /* Enable NOPROGRESS by default, i.e. no progress output */
+-    res = curl_easy_setopt(self->handle, CURLOPT_NOPROGRESS, (long)1);
+-    if (res != CURLE_OK)
+-        goto error;
+-
+-    /* Disable VERBOSE by default, i.e. no verbose output */
+-    res = curl_easy_setopt(self->handle, CURLOPT_VERBOSE, (long)0);
+-    if (res != CURLE_OK)
+-        goto error;
+-
+-    /* Set FTP_ACCOUNT to NULL by default */
+-    res = curl_easy_setopt(self->handle, CURLOPT_FTP_ACCOUNT, NULL);
+-    if (res != CURLE_OK)
+-        goto error;
+-
+-    /* Set default USERAGENT */
+-    s = (char *) malloc(7 + strlen(LIBCURL_VERSION) + 1);
+-    if (s == NULL)
+-        goto error;
+-    strcpy(s, "PycURL/"); strcpy(s+7, LIBCURL_VERSION);
+-    res = curl_easy_setopt(self->handle, CURLOPT_USERAGENT, (char *) s);
+-    if (res != CURLE_OK) {
+-        free(s);
+-        goto error;
+-    }
+-    self->options[ OPT_INDEX(CURLOPT_USERAGENT) ] = s; s = NULL;
+-
++    res = util_curl_init(self);
++    if (res < 0)
++            goto error;
+     /* Success - return new object */
+     return self;
+ 
+@@ -1425,6 +1442,7 @@
+ do_curl_reset(CurlObject *self)
+ {
+     unsigned int i;
++    int res;
+ 
+     curl_easy_reset(self->handle);
+ 
+@@ -1452,7 +1470,17 @@
+         }
+     }
+ 
++    res = util_curl_init(self);
++    if (res < 0)
++            goto error;
++
++    Py_INCREF(Py_None);
+     return Py_None;
++
++error:
++    Py_DECREF(self);    /* this also closes self->handle */
++    PyErr_SetString(ErrorObject, "resetting curl failed");
++    return NULL;
+ }
+ 
+ /* --------------- unsetopt/setopt/getinfo --------------- */
+@@ -1501,6 +1529,8 @@
+     case CURLOPT_RANDOM_FILE:
+     case CURLOPT_SSL_CIPHER_LIST:
+     case CURLOPT_USERPWD:
++    case CURLOPT_PROXYUSERNAME:
++    case CURLOPT_PROXYPASSWORD:
+         SETOPT((char *) 0);
+         opt_index = OPT_INDEX(option);
+         break;
+@@ -1627,6 +1657,9 @@
+         case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
+         case CURLOPT_CRLFILE:
+         case CURLOPT_ISSUERCERT:
++        case CURLOPT_NOPROXY:
++        case CURLOPT_PROXYUSERNAME:
++        case CURLOPT_PROXYPASSWORD:
+ /* FIXME: check if more of these options allow binary data */
+             str = PyString_AsString_NoNUL(obj);
+             if (str == NULL)
+@@ -3561,6 +3594,9 @@
+     insint_c(d, "PROXYTYPE_HTTP", CURLPROXY_HTTP);
+     insint_c(d, "PROXYTYPE_SOCKS4", CURLPROXY_SOCKS4);
+     insint_c(d, "PROXYTYPE_SOCKS5", CURLPROXY_SOCKS5);
++    insint_c(d, "PROXYTYPE_HTTP_1_0", CURLPROXY_HTTP_1_0);
++    insint_c(d, "PROXYTYPE_SOCKS4A", CURLPROXY_SOCKS4A);
++    insint_c(d, "PROXYTYPE_SOCKS5_HOSTNAME", CURLPROXY_SOCKS5_HOSTNAME);
+ 
+     /* curl_httpauth: constants for setopt(HTTPAUTH, x) */
+     insint_c(d, "HTTPAUTH_NONE", CURLAUTH_NONE);
+@@ -3735,6 +3771,9 @@
+     insint_c(d, "CRLFILE", CURLOPT_CRLFILE);
+     insint_c(d, "ISSUERCERT", CURLOPT_ISSUERCERT);
+     insint_c(d, "ADDRESS_SCOPE", CURLOPT_ADDRESS_SCOPE);
++    insint_c(d, "NOPROXY", CURLOPT_NOPROXY);
++    insint_c(d, "PROXYUSERNAME", CURLOPT_PROXYUSERNAME);
++    insint_c(d, "PROXYPASSWORD", CURLOPT_PROXYPASSWORD);
+ 
+     insint_c(d, "M_TIMERFUNCTION", CURLMOPT_TIMERFUNCTION);
+     insint_c(d, "M_SOCKETFUNCTION", CURLMOPT_SOCKETFUNCTION);

Deleted: csw/mgar/pkg/lang-python/pycurl/trunk/files/remove-static-libs.patch
===================================================================
--- csw/mgar/pkg/lang-python/pycurl/trunk/files/remove-static-libs.patch	2011-12-09 13:27:28 UTC (rev 16442)
+++ csw/mgar/pkg/lang-python/pycurl/trunk/files/remove-static-libs.patch	2011-12-09 14:22:32 UTC (rev 16443)
@@ -1,12 +0,0 @@
---- pycurl-7.19.0/setup.py.orig	2010-01-21 14:37:49.752839487 +0100
-+++ pycurl-7.19.0/setup.py	2010-01-21 14:38:07.351889431 +0100
-@@ -97,8 +97,7 @@
-         else:
-             extra_compile_args.append(e)
-     libs = split_quoted(
--        os.popen("'%s' --libs" % CURL_CONFIG).read()+\
--        os.popen("'%s' --static-libs" % CURL_CONFIG).read())
-+        os.popen("'%s' --libs" % CURL_CONFIG).read())
-     for e in libs:
-         if e[:2] == "-l":
-             libraries.append(e[2:])

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list