markupsafe: upgraded package to upstream

Upgraded dev-python/markupsafe to version 0.18 on x86
Nothing uses this currently.

BUG=None
TEST=`emerge-link markupsafe` works

Change-Id: If284f86f6faf93e1601a8f5a7e850b8b3e9515e6
Reviewed-on: https://chromium-review.googlesource.com/191012
Reviewed-by: Jon Salz <jsalz@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/dev-python/markupsafe/Manifest b/dev-python/markupsafe/Manifest
index f5d53ab..762f7f6 100644
--- a/dev-python/markupsafe/Manifest
+++ b/dev-python/markupsafe/Manifest
@@ -1 +1 @@
-DIST MarkupSafe-0.15.tar.gz 11265 RMD160 862475bb620c6b92be74a8daa2eafe09a488fcb8 SHA1 81e0c898c289721d5b1aa70ffc0dfc35886ea92a SHA256 339ec04d20ad9cdccbfe9f38dce6182cc504ce789e5d0f9647eaa752f0f95300
+DIST MarkupSafe-0.18.tar.gz 11748 SHA256 b7d5d688bdd345bfa897777d297756688cf02e1b3742c56885e2e5c2b996ff82 SHA512 0438ddf0fdab465c40d9afba8c14ad346be0868df654c11130d05e329992d456a9bc278551970cbd09244a29c77213885d0c363c951b0cfd4d9aa95b248ecff5 WHIRLPOOL 5254f021625fcbf45c3bf94f10a69149a248ae316d0f2f58b34ae008f66bac276d033057dd4f10b79873a4fbcadbd1796afae53fba67593a6cc370e43d34b845
diff --git a/dev-python/markupsafe/files/markupsafe-0.18-py3compat.patch b/dev-python/markupsafe/files/markupsafe-0.18-py3compat.patch
new file mode 100644
index 0000000..c823037
--- /dev/null
+++ b/dev-python/markupsafe/files/markupsafe-0.18-py3compat.patch
@@ -0,0 +1,142 @@
+https://github.com/tseaver/markupsafe/commit/553d9c3ba00e89967dfb608806f5703ef11c3f4c
+diff --git a/CHANGES b/CHANGES
+index 91a61c5..ec98481 100644
+diff --git a/markupsafe/__init__.py b/markupsafe/__init__.py
+index 25f00d3..902b2b2 100644
+--- a/markupsafe/__init__.py
++++ b/markupsafe/__init__.py
+@@ -10,12 +10,11 @@
+ """
+ import re
+ from markupsafe._compat import text_type, string_types, int_types, \
+-     unichr, PY2
++     unichr, PY2, _EMPTY, _BLANK
+ 
+ 
+ __all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent']
+ 
+-
+ _striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')
+ _entity_re = re.compile(r'&([^;]+);')
+ 
+@@ -65,7 +64,7 @@ class Markup(text_type):
+     """
+     __slots__ = ()
+ 
+-    def __new__(cls, base=u'', encoding=None, errors='strict'):
++    def __new__(cls, base=_EMPTY, encoding=None, errors='strict'):
+         if hasattr(base, '__html__'):
+             base = base.__html__()
+         if encoding is None:
+@@ -139,7 +138,7 @@ def handle_match(m):
+                     return unichr(int(name[1:]))
+             except ValueError:
+                 pass
+-            return u''
++            return _EMPTY
+         return _entity_re.sub(handle_match, text_type(self))
+ 
+     def striptags(self):
+@@ -150,7 +149,7 @@ def striptags(self):
+         >>> Markup("Main &raquo;  <em>About</em>").striptags()
+         u'Main \xbb About'
+         """
+-        stripped = u' '.join(_striptags_re.sub('', self).split())
++        stripped = _BLANK.join(_striptags_re.sub('', self).split())
+         return Markup(stripped).unescape()
+ 
+     @classmethod
+diff --git a/markupsafe/_compat.py b/markupsafe/_compat.py
+index 29e4a3d..0cc647e 100644
+--- a/markupsafe/_compat.py
++++ b/markupsafe/_compat.py
+@@ -17,8 +17,18 @@
+     string_types = (str,)
+     unichr = chr
+     int_types = (int,)
++
++    def _u(s):
++        return s
++
+ else:
+     text_type = unicode
+     string_types = (str, unicode)
+     unichr = unichr
+     int_types = (int, long)
++
++    def _u(s):
++        return unicode(s, 'unicode_escape')
++
++_EMPTY = _u('')
++_BLANK = _u(' ')
+diff --git a/markupsafe/tests.py b/markupsafe/tests.py
+index b34cc6e..f2f71a4 100644
+--- a/markupsafe/tests.py
++++ b/markupsafe/tests.py
+@@ -2,7 +2,7 @@
+ import gc
+ import unittest
+ from markupsafe import Markup, escape, escape_silent
+-from markupsafe._compat import text_type
++from markupsafe._compat import text_type, _u
+ 
+ 
+ class MarkupTestCase(unittest.TestCase):
+@@ -48,16 +48,16 @@ def test_tuple_interpol(self):
+         self.assertEqual(Markup('<em>%s:%s</em>') % (
+             '<foo>',
+             '<bar>',
+-        ), Markup(u'<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
++        ), Markup(_u('<em>&lt;foo&gt;:&lt;bar&gt;</em>')))
+ 
+     def test_dict_interpol(self):
+         self.assertEqual(Markup('<em>%(foo)s</em>') % {
+             'foo': '<foo>',
+-        }, Markup(u'<em>&lt;foo&gt;</em>'))
++        }, Markup(_u('<em>&lt;foo&gt;</em>')))
+         self.assertEqual(Markup('<em>%(foo)s:%(bar)s</em>') % {
+             'foo': '<foo>',
+             'bar': '<bar>',
+-        }, Markup(u'<em>&lt;foo&gt;:&lt;bar&gt;</em>'))
++        }, Markup(_u('<em>&lt;foo&gt;:&lt;bar&gt;</em>')))
+ 
+     def test_escaping(self):
+         # escaping and unescaping
+@@ -73,7 +73,7 @@ def test_all_set(self):
+     def test_escape_silent(self):
+         assert escape_silent(None) == Markup()
+         assert escape(None) == Markup(None)
+-        assert escape_silent('<foo>') == Markup(u'&lt;foo&gt;')
++        assert escape_silent('<foo>') == Markup(_u('&lt;foo&gt;'))
+ 
+     def test_splitting(self):
+         self.assertEqual(Markup('a b').split(), [
+@@ -101,8 +101,8 @@ def test_markup_leaks(self):
+             for item in range(1000):
+                 escape("foo")
+                 escape("<foo>")
+-                escape(u"foo")
+-                escape(u"<foo>")
++                escape(_u("foo"))
++                escape(_u("<foo>"))
+             counts.add(len(gc.get_objects()))
+         assert len(counts) == 1, 'ouch, c extension seems to leak objects'
+ 
+diff --git a/setup.py b/setup.py
+index a5ca3ef..cac6084 100644
+--- a/setup.py
++++ b/setup.py
+@@ -81,7 +81,12 @@ def run_setup(with_binary):
+             'License :: OSI Approved :: BSD License',
+             'Operating System :: OS Independent',
+             'Programming Language :: Python',
++            'Programming Language :: Python :: 2',
++            'Programming Language :: Python :: 2.6',
++            'Programming Language :: Python :: 2.7',
+             'Programming Language :: Python :: 3',
++            'Programming Language :: Python :: 3.2',
++            'Programming Language :: Python :: 3.3',
+             'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+             'Topic :: Software Development :: Libraries :: Python Modules',
+             'Topic :: Text Processing :: Markup :: HTML'
+
diff --git a/dev-python/markupsafe/markupsafe-0.15.ebuild b/dev-python/markupsafe/markupsafe-0.15.ebuild
deleted file mode 100644
index 1d6876a..0000000
--- a/dev-python/markupsafe/markupsafe-0.15.ebuild
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/markupsafe/markupsafe-0.15.ebuild,v 1.13 2012/05/09 00:11:59 aballier Exp $
-
-EAPI="3"
-SUPPORT_PYTHON_ABIS="1"
-DISTUTILS_SRC_TEST="setup.py"
-
-inherit distutils
-
-MY_PN="MarkupSafe"
-MY_P="${MY_PN}-${PV}"
-
-DESCRIPTION="Implements a XML/HTML/XHTML Markup safe string for Python"
-HOMEPAGE="http://pypi.python.org/pypi/MarkupSafe"
-SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="*"
-IUSE=""
-
-DEPEND="dev-python/setuptools"
-RDEPEND=""
-
-S="${WORKDIR}/${MY_P}"
-
-set_global_options() {
-	if [[ "$(python_get_implementation)" = "CPython" ]]; then
-		DISTUTILS_GLOBAL_OPTIONS=("--with-speedups")
-	else
-		DISTUTILS_GLOBAL_OPTIONS=()
-	fi
-}
-
-distutils_src_compile_pre_hook() {
-	set_global_options
-}
-
-distutils_src_test_pre_hook() {
-	set_global_options
-}
-
-distutils_src_install_pre_hook() {
-	set_global_options
-}
-
-src_install() {
-	distutils_src_install
-	python_clean_installation_image
-}
diff --git a/dev-python/markupsafe/markupsafe-0.18.ebuild b/dev-python/markupsafe/markupsafe-0.18.ebuild
new file mode 100644
index 0000000..8ac7725
--- /dev/null
+++ b/dev-python/markupsafe/markupsafe-0.18.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/markupsafe/markupsafe-0.18.ebuild,v 1.3 2013/09/05 18:46:10 mgorny Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} pypy2_0 )
+inherit distutils-r1
+
+MY_PN="MarkupSafe"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Implements a XML/HTML/XHTML Markup safe string for Python"
+HOMEPAGE="http://pypi.python.org/pypi/MarkupSafe"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="*"
+IUSE=""
+
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+python_prepare_all() {
+	local PATCHES="${FILESDIR}"/markupsafe-0.18-py3compat.patch
+	distutils-r1_python_prepare_all
+}
+
+python_test() {
+	esetup.py test
+}
diff --git a/metadata/md5-cache/dev-python/markupsafe-0.15 b/metadata/md5-cache/dev-python/markupsafe-0.15
deleted file mode 100644
index 7ca5ec4..0000000
--- a/metadata/md5-cache/dev-python/markupsafe-0.15
+++ /dev/null
@@ -1,12 +0,0 @@
-DEFINED_PHASES=compile install postinst postrm prepare test
-DEPEND=dev-python/setuptools dev-lang/python
-DESCRIPTION=Implements a XML/HTML/XHTML Markup safe string for Python
-EAPI=3
-HOMEPAGE=http://pypi.python.org/pypi/MarkupSafe
-KEYWORDS=*
-LICENSE=BSD
-RDEPEND=dev-lang/python
-SLOT=0
-SRC_URI=mirror://pypi/M/MarkupSafe/MarkupSafe-0.15.tar.gz
-_eclasses_=distutils	c2658824b3debc637c77b58e1d658fab	multilib	fac675dcccf94392371a6abee62d909f	python	305197b0aa1194fa3ef67ca21f6faa7e	toolchain-funcs	48b38a216afb92db6314d6c3187abea3
-_md5_=5c11634a4cd2f3859d52d0581600bd68
diff --git a/metadata/md5-cache/dev-python/markupsafe-0.18 b/metadata/md5-cache/dev-python/markupsafe-0.18
new file mode 100644
index 0000000..c2c6040
--- /dev/null
+++ b/metadata/md5-cache/dev-python/markupsafe-0.18
@@ -0,0 +1,13 @@
+DEFINED_PHASES=compile configure install prepare test
+DEPEND=dev-python/setuptools[python_targets_python2_6(-)?,python_targets_python2_7(-)?,python_targets_python3_2(-)?,python_targets_python3_3(-)?,python_targets_pypy2_0(-)?,-python_single_target_python2_6(-),-python_single_target_python2_7(-),-python_single_target_python3_2(-),-python_single_target_python3_3(-),-python_single_target_pypy2_0(-)] python_targets_python2_6? ( >=dev-lang/python-2.6.8-r3:2.6 ) python_targets_python2_7? ( >=dev-lang/python-2.7.3-r2:2.7 ) python_targets_python3_2? ( >=dev-lang/python-3.2.5-r2:3.2 ) python_targets_python3_3? ( >=dev-lang/python-3.3.2-r2:3.3 ) python_targets_pypy2_0? ( >=virtual/pypy-2.0.2:2.0 ) dev-lang/python-exec:=[python_targets_python2_6(-)?,python_targets_python2_7(-)?,python_targets_python3_2(-)?,python_targets_python3_3(-)?,python_targets_pypy2_0(-)?,-python_single_target_python2_6(-),-python_single_target_python2_7(-),-python_single_target_python3_2(-),-python_single_target_python3_3(-),-python_single_target_pypy2_0(-)]
+DESCRIPTION=Implements a XML/HTML/XHTML Markup safe string for Python
+EAPI=5
+HOMEPAGE=http://pypi.python.org/pypi/MarkupSafe
+IUSE=python_targets_python2_6 python_targets_python2_7 python_targets_python3_2 python_targets_python3_3 python_targets_pypy2_0
+KEYWORDS=*
+LICENSE=BSD
+RDEPEND=python_targets_python2_6? ( >=dev-lang/python-2.6.8-r3:2.6 ) python_targets_python2_7? ( >=dev-lang/python-2.7.3-r2:2.7 ) python_targets_python3_2? ( >=dev-lang/python-3.2.5-r2:3.2 ) python_targets_python3_3? ( >=dev-lang/python-3.3.2-r2:3.3 ) python_targets_pypy2_0? ( >=virtual/pypy-2.0.2:2.0 ) dev-lang/python-exec:=[python_targets_python2_6(-)?,python_targets_python2_7(-)?,python_targets_python3_2(-)?,python_targets_python3_3(-)?,python_targets_pypy2_0(-)?,-python_single_target_python2_6(-),-python_single_target_python2_7(-),-python_single_target_python3_2(-),-python_single_target_python3_3(-),-python_single_target_pypy2_0(-)]
+SLOT=0
+SRC_URI=mirror://pypi/M/MarkupSafe/MarkupSafe-0.18.tar.gz
+_eclasses_=distutils-r1	52a35bc5600044dfdf1a3f1fa258dc93	eutils	a108f00cccac414097bcbbbb5de01762	multibuild	c2f33b0eedd7bcfd5bc226baa8da7837	multilib	fac675dcccf94392371a6abee62d909f	multiprocessing	1512bdfe7004902b8cd2c466fc3df772	python-r1	cd956d5a4bac2209a64d0f4851cc115d	python-utils-r1	4fc11614abf37ede29a4eb8aaae8a22a	toolchain-funcs	48b38a216afb92db6314d6c3187abea3
+_md5_=9c3ab673917445a5855c3535926aefab