From: Zac Medico Date: Sat, 10 Apr 2010 21:11:47 +0000 (-0700) Subject: Make cpv_getversion handle invalid cpv and add cpv_getversion to __all__. X-Git-Tag: v2.2_rc68~656 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c37319fac1e0ff59930ab3ff3bd468b27a5a1346;p=portage.git Make cpv_getversion handle invalid cpv and add cpv_getversion to __all__. --- diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 89ab6e180..1db421a7e 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -4,7 +4,7 @@ __all__ = [ 'best', 'catpkgsplit', 'catsplit', - 'cpv_getkey', 'pkgcmp', 'pkgsplit', + 'cpv_getkey', 'cpv_getversion', 'pkgcmp', 'pkgsplit', 'ververify', 'vercmp' ] @@ -338,6 +338,8 @@ def cpv_getkey(mycpv): def cpv_getversion(mycpv): """Returns the v (including revision) from an cpv.""" cp = cpv_getkey(mycpv) + if cp is None: + return None return mycpv[len(cp+"-"):] def catsplit(mydep):