aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2012-02-20 08:21:07 +0100
committerCorentin Chary <corentincj@iksaif.net>2012-02-20 08:21:07 +0100
commitdf1d7783659c21dd52afee20e12f6c0c37cbd565 (patch)
tree1607573b580a8edd8fe83a844eb56983418fd731 /pym/euscan/helpers.py
parenteuscan: re-indent blacklists (diff)
downloadeuscan-df1d7783659c21dd52afee20e12f6c0c37cbd565.tar.gz
euscan-df1d7783659c21dd52afee20e12f6c0c37cbd565.tar.bz2
euscan-df1d7783659c21dd52afee20e12f6c0c37cbd565.zip
euscan: add a quick /_rc/-rc/ hack
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Diffstat (limited to 'pym/euscan/helpers.py')
-rw-r--r--pym/euscan/helpers.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pym/euscan/helpers.py b/pym/euscan/helpers.py
index 6d2614e..981fca0 100644
--- a/pym/euscan/helpers.py
+++ b/pym/euscan/helpers.py
@@ -30,7 +30,8 @@ VERSION_CMP_PACKAGE_QUIRKS = {
'sys-process/htop' : htop_vercmp
}
-_v = r'((\d+)((\.\d+)*)([a-zA-Z]*?)(((-|_)(pre|p|beta|b|alpha|a|rc|r)\d*)*))'
+_v_end = '((-|_)(pre|p|beta|b|alpha|a|rc|r)\d*)'
+_v = r'((\d+)((\.\d+)*)([a-zA-Z]*?)(' + _v_end + '*))'
def cast_int_components(version):
for i, obj in enumerate(version):
@@ -91,6 +92,19 @@ def version_blacklisted(cp, version):
euscan.output.einfo("%s is blacklisted by rule %s" % (cpv, bv))
return rule is not None
+def version_change_end_sep(version):
+ match = re.match('.*' + _v_end, version)
+ if not match:
+ return None
+ end = match.group(1)
+ if end[0] == '_':
+ newend = end.replace('_', '-')
+ elif end[0] == '-':
+ newend = end.replace('-', '_')
+ else:
+ return None
+ return version.replace(end, newend)
+
def version_filtered(cp, base, version):
if vercmp(cp, base, version) >= 0:
return True