python-httplib2: update to 0.10.2

This commit is contained in:
Alessio Sergi 2017-02-06 23:30:38 +01:00
parent 1f3b74599d
commit a495938aa7
3 changed files with 11 additions and 82 deletions

View file

@ -1,25 +0,0 @@
Description: Close connection on certificate mismatch to avoid reuse
Author: Roman Podolyaka <rpodolyaka...mirantis.com>
Forwarded: https://code.google.com/p/httplib2/issues/detail?id=282
diff -r 93291649202b python2/httplib2/__init__.py
--- a/python2/httplib2/__init__.py Tue Mar 26 14:17:48 2013 -0400
+++ b/python2/httplib2/__init__.py Tue Apr 23 10:32:15 2013 +0300
@@ -1030,7 +1030,7 @@
raise CertificateHostnameMismatch(
'Server presented certificate that does not match '
'host %s: %s' % (hostname, cert), hostname, cert)
- except ssl_SSLError, e:
+ except (ssl_SSLError, CertificateHostnameMismatch), e:
if sock:
sock.close()
if self.sock:
@@ -1040,7 +1040,7 @@
# to get at more detailed error information, in particular
# whether the error is due to certificate validation or
# something else (such as SSL protocol mismatch).
- if e.errno == ssl.SSL_ERROR_SSL:
+ if hasattr(e, 'errno') and e.errno == ssl.SSL_ERROR_SSL:
raise SSLHandshakeError(e)
else:
raise

View file

@ -1,49 +0,0 @@
Description: Use system ca certificates, not the bundled ones
Author: Marc Deslauriers <marc.deslauriers@canonical.com>
Forwarded: not-needed
Bug-Ubuntu: https://launchpad.net/bugs/882027
Index: b/python2/httplib2/__init__.py
===================================================================
--- a/python2/httplib2/__init__.py 2013-03-18 22:37:43.423868573 +0100
+++ b/python2/httplib2/__init__.py 2013-03-18 22:37:43.419868572 +0100
@@ -190,9 +190,8 @@
import ca_certs_locater
CA_CERTS = ca_certs_locater.get()
except ImportError:
- # Default CA certificates file bundled with httplib2.
- CA_CERTS = os.path.join(
- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
+ # Use system CA certificates
+ CA_CERTS = "/etc/ssl/certs/ca-certificates.crt"
# Which headers are hop-by-hop headers by default
HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']
Index: b/python3/httplib2/__init__.py
===================================================================
--- a/python3/httplib2/__init__.py 2013-03-18 22:37:43.423868573 +0100
+++ b/python3/httplib2/__init__.py 2013-03-18 22:37:43.419868572 +0100
@@ -123,9 +123,8 @@
# Which headers are hop-by-hop headers by default
HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']
-# Default CA certificates file bundled with httplib2.
-CA_CERTS = os.path.join(
- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
+# Use system CA certificates
+CA_CERTS = "/etc/ssl/certs/ca-certificates.crt"
def _get_end2end_headers(response):
hopbyhop = list(HOP_BY_HOP)
Index: b/setup.py
===================================================================
--- a/setup.py 2013-03-18 22:37:43.423868573 +0100
+++ b/setup.py 2013-03-18 22:37:43.419868572 +0100
@@ -61,7 +61,6 @@
""",
package_dir=pkgdir,
packages=['httplib2'],
- package_data={'httplib2': ['*.txt']},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',

View file

@ -1,28 +1,31 @@
# Template file for 'python-httplib2'
pkgname=python-httplib2
version=0.9.2
revision=3
version=0.10.2
revision=1
noarch=yes
patch_args="-Np1"
wrksrc="httplib2-${version}"
build_style=python-module
hostmakedepends="python-setuptools python3-setuptools"
depends="python ca-certificates"
pycompile_module="httplib2"
short_desc="A comprehensive HTTP client library (Python2)"
short_desc="Comprehensive HTTP client library (Python2)"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="https://github.com/httplib2/httplib2"
license="MIT"
distfiles="${PYPI_SITE}/h/httplib2/httplib2-${version}.tar.gz"
checksum=c3aba1c9539711551f4d83e857b316b5134a1c4ddce98a875b7027be7dd6d988
checksum=ee10fe4505d1bb5b3d519e9b004cab7a12d10ce160aceab626a00cf5937d8927
post_extract() {
chmod -R a+rX .
post_install() {
# use system ca certificates
for py_sitelib in $py2_sitelib $py3_sitelib; do
rm -rf ${DESTDIR}/${py_sitelib}/httplib2/cacerts.txt
ln -sf /etc/ssl/cert.pem ${DESTDIR}/${py_sitelib}/httplib2/cacerts.txt
done
}
python3-httplib2_package() {
noarch=yes
depends="python3"
depends="python3 ca-certificates"
pycompile_module="httplib2"
replaces="python3.4-httplib2>=0"
short_desc="${short_desc/Python2/Python3}"