summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-09-20 19:32:43 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-09-20 19:32:43 +0000
commitb9491fa7ef269b8e261b16881f5e03de1c3ae608 (patch)
treed630b5e5dde1e28ac84ee45e0d1018edad168722 /dev-python/4suite
parentAdd ~amd64 keyword. Tested on several machines and seems to work as intended. (diff)
downloadgentoo-2-b9491fa7ef269b8e261b16881f5e03de1c3ae608.tar.gz
gentoo-2-b9491fa7ef269b8e261b16881f5e03de1c3ae608.tar.bz2
gentoo-2-b9491fa7ef269b8e261b16881f5e03de1c3ae608.zip
Improve version parsing (bug #246683).
(Portage version: 2.2_rc85_p6/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/4suite')
-rw-r--r--dev-python/4suite/4suite-1.0.2-r1.ebuild6
-rw-r--r--dev-python/4suite/ChangeLog6
-rw-r--r--dev-python/4suite/files/4suite-1.0.2-version_parsing.patch43
3 files changed, 50 insertions, 5 deletions
diff --git a/dev-python/4suite/4suite-1.0.2-r1.ebuild b/dev-python/4suite/4suite-1.0.2-r1.ebuild
index 8d9d2fdc8324..4f232bb09666 100644
--- a/dev-python/4suite/4suite-1.0.2-r1.ebuild
+++ b/dev-python/4suite/4suite-1.0.2-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/4suite/4suite-1.0.2-r1.ebuild,v 1.10 2010/07/21 21:46:04 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/4suite/4suite-1.0.2-r1.ebuild,v 1.11 2010/09/20 19:32:43 arfrever Exp $
EAPI="3"
PYTHON_DEPEND="2"
@@ -33,9 +33,7 @@ S=${WORKDIR}/${MY_P}
src_prepare() {
epatch "${FILESDIR}/${P}-amd64_python2.5.patch"
epatch "${FILESDIR}/${P}-config.patch"
-
- # Improve handling of package versions with '+' character.
- sed -e $'/self._original = vstring/a\\\n vstring = vstring.rstrip(\'+\')' -i Ft/Lib/DistExt/Version.py || die "sed failed"
+ epatch "${FILESDIR}/${P}-version_parsing.patch"
if ! use doc; then
sed -e "/'build_docs'/d" -i Ft/Lib/DistExt/Build.py || die "sed failed"
diff --git a/dev-python/4suite/ChangeLog b/dev-python/4suite/ChangeLog
index 65ff86772fd9..f5b80b2fd7ca 100644
--- a/dev-python/4suite/ChangeLog
+++ b/dev-python/4suite/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-python/4suite
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/4suite/ChangeLog,v 1.44 2010/07/21 21:46:04 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/4suite/ChangeLog,v 1.45 2010/09/20 19:32:43 arfrever Exp $
+
+ 20 Sep 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
+ 4suite-1.0.2-r1.ebuild, +files/4suite-1.0.2-version_parsing.patch:
+ Improve version parsing (bug #246683).
21 Jul 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
4suite-1.0.2-r1.ebuild:
diff --git a/dev-python/4suite/files/4suite-1.0.2-version_parsing.patch b/dev-python/4suite/files/4suite-1.0.2-version_parsing.patch
new file mode 100644
index 000000000000..23d837c65e00
--- /dev/null
+++ b/dev-python/4suite/files/4suite-1.0.2-version_parsing.patch
@@ -0,0 +1,43 @@
+--- Ft/Lib/DistExt/Version.py
++++ Ft/Lib/DistExt/Version.py
+@@ -1,4 +1,5 @@
+ import re
++import warnings
+ from distutils.version import Version, StrictVersion
+
+ __all__ = ['CommonVersion', 'VersionPredicate', 'SplitProvision',
+@@ -40,6 +41,7 @@
+ def parse(self, vstring):
+ # save the original string for use by __str__
+ self._original = vstring
++ vstring = vstring.rstrip('+')
+
+ def versiontuple(vstring):
+ """
+@@ -53,9 +55,12 @@
+
+ # Get the version number
+ match = self.version_re.match(vstring)
+- if not match:
+- raise ValueError("invalid version number: %r" % vstring)
+- self.version = versiontuple(match.group())
++ if match:
++ self.version = versiontuple(match.group())
++ else:
++ warnings.filterwarnings("always", "invalid version number: .*, treating it as '0'", Warning)
++ warnings.warn("invalid version number: %r, treating it as '0'" % vstring, Warning)
++ self.version = (0,)
+
+ # Check for pre- and post-release tags
+ tags = []
+@@ -64,7 +69,9 @@
+ while start < end:
+ match = self.tag_re.match(vstring, start)
+ if not match:
+- raise ValueError("invalid release tag: %r" % vstring[start:])
++ warnings.filterwarnings("always", "invalid release tag: .*, ignoring it", Warning)
++ warnings.warn("invalid release tag: %r, ignoring it" % vstring[start:], Warning)
++ break
+ tag, version = match.groups()
+ tag = tag and tag.lower()
+ if tag in self.tag_aliases: