diff options
author | Ian Delaney <idella4@gentoo.org> | 2012-11-05 11:47:54 +0000 |
---|---|---|
committer | Ian Delaney <idella4@gentoo.org> | 2012-11-05 11:47:54 +0000 |
commit | 52e4e153c4828748c6fc0207dfc0ae507262ce95 (patch) | |
tree | 1b83f8d1c229fcaaad6b8dab50ed6a1e9b8a9eaa /dev-python/genshi | |
parent | Build with boost-1.51 Bug #425574 (diff) | |
download | gentoo-2-52e4e153c4828748c6fc0207dfc0ae507262ce95.tar.gz gentoo-2-52e4e153c4828748c6fc0207dfc0ae507262ce95.tar.bz2 gentoo-2-52e4e153c4828748c6fc0207dfc0ae507262ce95.zip |
Upstream patch added to fix tests, fixes Bug #433125
Diffstat (limited to 'dev-python/genshi')
-rw-r--r-- | dev-python/genshi/Manifest | 3 | ||||
-rw-r--r-- | dev-python/genshi/files/genshi-0.6-html_test.patch | 37 | ||||
-rw-r--r-- | dev-python/genshi/genshi-0.6.ebuild | 33 |
3 files changed, 69 insertions, 4 deletions
diff --git a/dev-python/genshi/Manifest b/dev-python/genshi/Manifest index 4f0e0099dce6..5d395c2ec02e 100644 --- a/dev-python/genshi/Manifest +++ b/dev-python/genshi/Manifest @@ -1,4 +1,5 @@ +AUX genshi-0.6-html_test.patch 2000 SHA256 76e1b2f5acc4c90c6f5c7a273b5510474ca0b1226246df382e2f3e6f52bbbb0f SHA512 009e9e2e727cec1dd895dfb36e6cd783f509648d6a8663c8db41258d12f93c5093a90f0d4d3c6671532f018623e505e8cee53cb3cc501cb25ee4d195e96b74fd WHIRLPOOL a8d10385617fae64b3e3d87826b43001ed1d39882cb2affdb336d91d44259e55c23b78f5c61b3d8da8ab348626b9bfa4c21f8b4b6949510aa9991ffe5ce9a0e4 DIST Genshi-0.6.tar.gz 433946 SHA256 32aaf76a03f88efa04143bf80700399e6d84eead818fdd19d763fd76af972a4b SHA512 5e19e8cb9078ea587ce1a888bc02108a680a5d30b6b0e36a9280d10bc89142bacaa02532b432ce1c72504fc56d3fca72c5c0537bc98602572cd0f4a90b5f45d7 WHIRLPOOL 263bf8b3a19f3966b504fce200050b56be0b1d816d59f870dead740fb50a06758529ab7140573811201df9d0b56481f2d83a8f1b4bb6b186bc6c15110d905824 -EBUILD genshi-0.6.ebuild 975 SHA256 7a03ca8c3172eb15efebc78040d1891484d1e0311bd7477a88df157f40f31340 SHA512 dafb78d41437ec3dca7044238e81d722f088b2d18ed9a1b969e753a1d0c42449cdf926479593a54fec72576bb6d96ab74931d48d169dd36922113583460dc1fa WHIRLPOOL 737854ae8bae81091c919e56feb2863d19fe0dd828f961e4ff7a3bf6a3c3be09185444365d37ea1fcf3ac923f6a9e3fb4a9bbac7e6d8672af7390afc32f4133f +EBUILD genshi-0.6.ebuild 2067 SHA256 1c9ffd848db95b89068c076b457a05dfd1f341cda6d7ad61c032df3894c5eb42 SHA512 896805dfffa40940babedba5f90df524976df089033826ec85974924c8df66f66729b3acc51ce626c97f6e080f72c1eebb333f8b61215f008f00d207444fcfc2 WHIRLPOOL c69a1e0f730e17718a596c57f85cf05f6a20610b331184ba4ad3a14c09b587c2acff12d9aee1e213836eff95e92b5320e6418c798340ed5d8f648d8b680e2131 MISC ChangeLog 4172 SHA256 fc7d88112ba5d269a99d1536407b46d0c32a9fe3526aef3d5d8ccae9dd7ed968 SHA512 d6212b4653594a72fb42b9f0a30e3b9b9fb1b8662ecd0b71057c7090c76c3001c87dc10e67c8f8dcb871bc0c593e9bb8a2bff39b43d8c1172be653c56d1995a6 WHIRLPOOL 7fa09c3094dbe45abb11bdbd73016016280052b58211790fc21afbdb6d6f6ea6cb42c1d47679f80448ff32f5daa4a7c7ca61627a8a10bfb9cf617d950eaa72d9 MISC metadata.xml 160 SHA256 6cd954a9de2307c57d32b25fa3599dee2908a4ddc6a98594f593d53577307a3a SHA512 7c02a1de1ddcb6b7c6378cceff0458da3a15d5381417f7cdf01874e7c372664b8899863f41b3a2fd8d6ad67ceb732dac6da0cc17575bf8e3e6d89480417c6628 WHIRLPOOL ed2795e4466eda8c804d5067c87386e269a59fe959393057ca5ddc36851e00f5210c4da1adf4bbdfdbb7d1d3d5c60aced25727ca12fdc8305d9e263a3aca9b13 diff --git a/dev-python/genshi/files/genshi-0.6-html_test.patch b/dev-python/genshi/files/genshi-0.6-html_test.patch new file mode 100644 index 000000000000..4f74d6b999f5 --- /dev/null +++ b/dev-python/genshi/files/genshi-0.6-html_test.patch @@ -0,0 +1,37 @@ +Add/Change #501 (test_sanitize_remove_src_javascript fails due to HTMLParser bugfixes in cpython) +Add/Change #500 (test_sanitize_remove_script_elem fails due to HTMLParser bugfixes in cpython) +--- a/genshi/filters/tests/html.py ++++ b/genshi/filters/tests/html.py +@@ -365,9 +365,12 @@ + self.assertEquals('', (html | HTMLSanitizer()).render()) + html = HTML('<SCRIPT SRC="http://example.com/"></SCRIPT>') + self.assertEquals('', (html | HTMLSanitizer()).render()) +- self.assertRaises(ParseError, HTML, '<SCR\0IPT>alert("foo")</SCR\0IPT>') +- self.assertRaises(ParseError, HTML, +- '<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>') ++ html = HTML('<SCR\0IPT>alert("foo")</SCR\0IPT>') ++ self.assertEquals('<SCR\x00IPT>alert("foo")', ++ (html | HTMLSanitizer()).render()) ++ html = HTML('<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>') ++ self.assertEquals('<SCRIPT&XYZ; SRC="http://example.com/">', ++ (html | HTMLSanitizer()).render()) + + def test_sanitize_remove_onclick_attr(self): + html = HTML('<div onclick=\'alert("foo")\' />') + +--- a/genshi/filters/tests/html.py ++++ b/genshi/filters/tests/html.py +@@ -437,9 +440,9 @@ + # Case-insensitive protocol matching + html = HTML('<IMG SRC=\'JaVaScRiPt:alert("foo")\'>') + self.assertEquals('<img/>', (html | HTMLSanitizer()).render()) +- # Grave accents (not parsed) +- self.assertRaises(ParseError, HTML, +- '<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>') ++ # Grave accents. ++ html = HTML('<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>') ++ self.assertEquals('<img/>', (html | HTMLSanitizer()).render()) + # Protocol encoded using UTF-8 numeric entities + html = HTML('<IMG SRC=\'javascri' + 'pt:alert("foo")\'>') + diff --git a/dev-python/genshi/genshi-0.6.ebuild b/dev-python/genshi/genshi-0.6.ebuild index f5446dd31aca..1690f31394b7 100644 --- a/dev-python/genshi/genshi-0.6.ebuild +++ b/dev-python/genshi/genshi-0.6.ebuild @@ -1,14 +1,15 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/genshi/genshi-0.6.ebuild,v 1.7 2012/01/06 21:26:43 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/genshi/genshi-0.6.ebuild,v 1.8 2012/11/05 11:47:54 idella4 Exp $ EAPI="3" PYTHON_DEPEND="2" SUPPORT_PYTHON_ABIS="1" RESTRICT_PYTHON_ABIS="3.* *-jython" -DISTUTILS_SRC_TEST="setup.py" +# Need call setup.py test manually making this for now redundant +#DISTUTILS_SRC_TEST="setup.py" -inherit distutils +inherit distutils eutils MY_P="Genshi-${PV}" @@ -26,6 +27,32 @@ RDEPEND="${DEPEND}" S="${WORKDIR}/${MY_P}" +src_prepare() { + cp genshi/filters/tests/html.py orig_html.py || die + epatch "${FILESDIR}"/${P}-html_test.patch +} + +src_test() { + # The html_test.patch is needed only for python2.7 for now, breaks all other versions. The html.py needs + # adjusting only to pass the tests for 2.7. Other ABIs still need the original filters/tests/html.py, + # hence this long winded juggling appears the only method to set a viable genshi/filters/tests/html.py + # for each python version. The test needed patching, instead they changed the genshi/filters/tests/html.py + setHtmlpy() { + for f in build-${PYTHON_ABI}; do + if [[ ${PYTHON_ABI:2:3} < '7' || ${PYTHON_ABI:4:4} == "pypy" ]]; then + mv genshi/filters/tests/html.py patched_html.py || die + mv orig_html.py genshi/filters/tests/html.py || die + "$(PYTHON)" setup.py test + mv genshi/filters/tests/html.py orig_html.py + mv patched_html.py genshi/filters/tests/html.py || die + else + "$(PYTHON)" setup.py test + fi + done + } + python_execute_function setHtmlpy +} + src_install() { distutils_src_install |