From b571300bec3dec1d90d450b9d257bf577feebac8 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Tue, 12 Apr 2016 16:36:57 +0200 Subject: dev-python/dulwich: fix possible hang with gzip achieved by use of patch 'dulwich-0.12.0-fix-gzip-hang.patch', run in revbumped ebuild Package-Manager: portage-2.2.28 Closes: https://github.com/gentoo/gentoo/pull/1247 Signed-off-by: Ian Delaney --- dev-python/dulwich/dulwich-0.12.0-r1.ebuild | 46 ++++++++++++++++++++++ dev-python/dulwich/dulwich-0.12.0.ebuild | 44 --------------------- .../files/dulwich-0.12.0-fix-gzip-hang.patch | 27 +++++++++++++ 3 files changed, 73 insertions(+), 44 deletions(-) create mode 100644 dev-python/dulwich/dulwich-0.12.0-r1.ebuild delete mode 100644 dev-python/dulwich/dulwich-0.12.0.ebuild create mode 100644 dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch (limited to 'dev-python/dulwich') diff --git a/dev-python/dulwich/dulwich-0.12.0-r1.ebuild b/dev-python/dulwich/dulwich-0.12.0-r1.ebuild new file mode 100644 index 000000000000..9cbd12a7fa71 --- /dev/null +++ b/dev-python/dulwich/dulwich-0.12.0-r1.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) + +inherit distutils-r1 + +DESCRIPTION="Pure-Python implementation of the Git file formats and protocols" +HOMEPAGE="https://github.com/jelmer/dulwich/ https://pypi.python.org/pypi/dulwich" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="doc examples test" + +DEPEND=" + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( dev-python/gevent[$(python_gen_usedep python2_7)] )" +RDEPEND="" +# https://github.com/jelmer/dulwich/pull/418 +PATCHES=( "${FILESDIR}/${P}-fix-gzip-hang.patch" ) + +DISTUTILS_IN_SOURCE_BUILD=1 + +python_compile_all() { + use doc && emake -C docs html +} + +python_test() { + # https://github.com/jelmer/dulwich/issues/196 + if [[ "${EPYTHON}" == pypy ]]; then + "${PYTHON}" -m unittest dulwich.tests.test_suite || die "Tests failed under pypy" + else + emake check + fi +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/build/html/. ) + use examples && local EXAMPLES=( examples/. ) + distutils-r1_python_install_all +} diff --git a/dev-python/dulwich/dulwich-0.12.0.ebuild b/dev-python/dulwich/dulwich-0.12.0.ebuild deleted file mode 100644 index c4426b10f89c..000000000000 --- a/dev-python/dulwich/dulwich-0.12.0.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=6 - -PYTHON_COMPAT=( python{2_7,3_4,3_5} ) - -inherit distutils-r1 - -DESCRIPTION="Pure-Python implementation of the Git file formats and protocols" -HOMEPAGE="https://github.com/jelmer/dulwich/ https://pypi.python.org/pypi/dulwich" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="doc examples test" - -DEPEND=" - dev-python/setuptools[${PYTHON_USEDEP}] - test? ( dev-python/gevent[$(python_gen_usedep python2_7)] )" -RDEPEND="" - -DISTUTILS_IN_SOURCE_BUILD=1 - -python_compile_all() { - use doc && emake -C docs html -} - -python_test() { - # https://github.com/jelmer/dulwich/issues/196 - if [[ "${EPYTHON}" == pypy ]]; then - "${PYTHON}" -m unittest dulwich.tests.test_suite || die "Tests failed under pypy" - else - emake check - fi -} - -python_install_all() { - use doc && local HTML_DOCS=( docs/build/html/. ) - use examples && local EXAMPLES=( examples/. ) - distutils-r1_python_install_all -} diff --git a/dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch b/dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch new file mode 100644 index 000000000000..3feed01181ed --- /dev/null +++ b/dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch @@ -0,0 +1,27 @@ +From 6ba8bba4f41ca9a2a4f7568ad45cabd41d7c9964 Mon Sep 17 00:00:00 2001 +From: Jonas Haag +Date: Tue, 12 Apr 2016 15:40:38 +0200 +Subject: [PATCH] Fix hang on Gzip decompression + +'LimitedInputFilter' should be applied before the Gzip middleware as +'CONTENT_LENGTH' refers to the size of the *compressed* body. If +applied in wrong order, this may cause 'copyfileobj()' to try to read +more data from the socket than is available, resulting in a call to +'recv()' that hangs forever. +--- + dulwich/web.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dulwich/web.py b/dulwich/web.py +index a4fa941..d8863fe 100644 +--- a/dulwich/web.py ++++ b/dulwich/web.py +@@ -415,7 +415,7 @@ def make_wsgi_chain(*args, **kwargs): + correctly wrapped with needed middleware. + """ + app = HTTPGitApplication(*args, **kwargs) +- wrapped_app = GunzipFilter(LimitedInputFilter(app)) ++ wrapped_app = LimitedInputFilter(GunzipFilter(app)) + return wrapped_app + + -- cgit v1.2.3-18-g5258