Fix cpv.py to handle prefix ebuild inter-revisions. Bug 313295
authorfuzzyray <fuzzyray@gentoo.org>
Mon, 22 Nov 2010 19:59:51 +0000 (19:59 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Mon, 22 Nov 2010 19:59:51 +0000 (19:59 -0000)
svn path=/trunk/gentoolkit/; revision=865

pym/gentoolkit/cpv.py

index 6e85767d48c5be69afe266a0880499eaf5ace6a6..8d81c9315d7c11d176019ae9c8a131e8d0efade5 100644 (file)
@@ -34,6 +34,8 @@ isvalid_version_re = re.compile("^(?:cvs\\.)?(?:\\d+)(?:\\.\\d+)*[a-z]?"
        "(?:_(p(?:re)?|beta|alpha|rc)\\d*)*$")
 isvalid_cat_re = re.compile("^(?:[a-zA-Z0-9][-a-zA-Z0-9+._]*(?:/(?!$))?)+$")
 _pkg_re = re.compile("^[a-zA-Z0-9+_]+$")
+# Prefix specific revision is of the form -r0<digit>+.<digit>+
+isvalid_rev_re = re.compile(r'(\d+|0\d+\.\d+)')
 
 # =======
 # Classes
@@ -249,6 +251,6 @@ def isvalid_pkg_name(chunks):
 
 
 def isvalid_rev(s):
-       return s and s[0] == 'r' and s[1:] != '0' and s[1:].isdigit() 
+       return s and s[0] == 'r' and isvalid_rev_re.match(s[1:])
 
 # vim: set ts=4 sw=4 tw=79: