From ef01d455f5c9b26d1743776afd5be2f64d31b1df Mon Sep 17 00:00:00 2001 From: Tom Briden Date: Mon, 15 Mar 2021 07:51:56 +0000 Subject: [PATCH] python-xcaplib: version bump to 2.0.0 --- .../python-xcaplib-work-with-eventlib.patch | 70 +++++++++++++++++++ ...heres-0 => python-xcaplib-2.0.0.exheres-0} | 10 ++- 2 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 packages/dev-python/python-xcaplib/files/python-xcaplib-work-with-eventlib.patch rename packages/dev-python/python-xcaplib/{python-xcaplib-1.2.1.exheres-0 => python-xcaplib-2.0.0.exheres-0} (55%) diff --git a/packages/dev-python/python-xcaplib/files/python-xcaplib-work-with-eventlib.patch b/packages/dev-python/python-xcaplib/files/python-xcaplib-work-with-eventlib.patch new file mode 100644 index 00000000..72abf1c5 --- /dev/null +++ b/packages/dev-python/python-xcaplib/files/python-xcaplib-work-with-eventlib.patch @@ -0,0 +1,70 @@ +Upstream: Yes +Source: https://github.com/AGProjects/python3-xcaplib/commit/066759cf355b152375767bee4c3858dc0b8087e4 + +From 066759cf355b152375767bee4c3858dc0b8087e4 Mon Sep 17 00:00:00 2001 +From: Worawut Boonpeang +Date: Fri, 4 Dec 2020 13:49:54 +0000 +Subject: [PATCH] xcaplib (Python3) work with eventlib + +--- + xcaplib/green.py | 4 +++- + xcaplib/xcapclient.py | 10 ++++++++-- + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/xcaplib/green.py b/xcaplib/green.py +index 237d9d8..d01ee11 100644 +--- a/xcaplib/green.py ++++ b/xcaplib/green.py +@@ -2,6 +2,8 @@ + from eventlib.green import socket, ssl, httplib, urllib2 + from xcaplib import httpclient + from xcaplib import client ++import urllib ++import http + + + class HTTPConnection(httplib.HTTPConnection): +@@ -22,7 +24,7 @@ def http_open(self, req): + + class HTTPSHandler(urllib.request.HTTPSHandler): + def https_open(self, req): +- return self.do_open(HTTPSConnection, req) ++ return self.do_open(http.client.HTTPSConnection, req) + + + class HTTPClient(httpclient.HTTPClient): +diff --git a/xcaplib/xcapclient.py b/xcaplib/xcapclient.py +index cd409df..384c237 100755 +--- a/xcaplib/xcapclient.py ++++ b/xcaplib/xcapclient.py +@@ -129,6 +129,8 @@ def setup_parser_request(parser): + parser.add_option('--etag', help="perform a conditional operation", metavar='ETAG') + parser.add_option('--add-header', dest='headers', + action='append', default=[], help=optparse.SUPPRESS_HELP) ++ parser.add_option("--eventlib", dest='eventlib_enable', ++ help="Enables non-blocking mode using eventlib library") + parser.add_option("-i", dest='input_filename', + help="source file for the PUT request; default is ") + parser.add_option("-o", dest='output_filename', +@@ -366,7 +368,11 @@ def update_options_from_config(options): + setattr(options, key, value) + + def parse_args(): +- argv = sys.argv[1:] ++ argv = None ++ if "--eventlib" in sys.argv[1:]: ++ argv = sys.argv[2:] ++ else: ++ argv = sys.argv[1:] + + if not argv: + sys.exit('Type %s -h for help.' % sys.argv[0]) +@@ -496,7 +502,7 @@ def get_exit_code(http_error): + return 3 + + def main(): +- if sys.argv[0].endswith('-eventlib'): ++ if "--eventlib" in sys.argv[1:]: + from xcaplib.green import XCAPClient as client_class + else: + client_class = XCAPClient diff --git a/packages/dev-python/python-xcaplib/python-xcaplib-1.2.1.exheres-0 b/packages/dev-python/python-xcaplib/python-xcaplib-2.0.0.exheres-0 similarity index 55% rename from packages/dev-python/python-xcaplib/python-xcaplib-1.2.1.exheres-0 rename to packages/dev-python/python-xcaplib/python-xcaplib-2.0.0.exheres-0 index 2a265ee1..dd03f754 100644 --- a/packages/dev-python/python-xcaplib/python-xcaplib-1.2.1.exheres-0 +++ b/packages/dev-python/python-xcaplib/python-xcaplib-2.0.0.exheres-0 @@ -1,11 +1,11 @@ # Copyright 2016 Julian Ospald # Distributed under the terms of the GNU General Public License v2 -require setup-py [ import=distutils blacklist="3" ] +require setup-py [ import=distutils blacklist="2" multibuild=false ] +require github [ user="AGProjects" pn="python3-xcaplib" tag="${PV}" ] SUMMARY="Python library for managing XML documents on XCAP server" HOMEPAGE="http://sipsimpleclient.org" -DOWNLOADS="http://download.ag-projects.com/XCAP/${PNV}.tar.gz" LICENCES="GPL-2" SLOT="0" @@ -15,6 +15,10 @@ MYOPTIONS="" DEPENDENCIES=" run: dev-python/lxml[python_abis:*(-)?] - dev-python/python-application[python_abis:*(-)?] + dev-python/python-application[>=3.0.3][python_abis:*(-)?] " +DEFAULT_SRC_PREPARE_PATCHES=( + "${FILES}"/${PN}-work-with-eventlib.patch +) +