From: Zac Medico Date: Sun, 14 Oct 2012 02:44:18 +0000 (-0700) Subject: Simplify Display.get_ver_str(). X-Git-Tag: v2.2.0_alpha138~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6d6868206d5109fbbda9b716b597adb3440666bb;p=portage.git Simplify Display.get_ver_str(). --- diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 6ae022e00..8a1e63ae5 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -676,12 +676,10 @@ class Display(object): @param pkg: _emerge.Package.Package instance @rtype string """ - ver_str = list(catpkgsplit(pkg.cpv)[2:]) - if ver_str[1] == "r0": - ver_str[1] = "" - else: - ver_str[1] = "-" + ver_str[1] - return ver_str[0]+ver_str[1] + ver_str = pkg.cpv.version + if ver_str.endswith("-r0"): + ver_str = ver_str[:-3] + return ver_str def _get_installed_best(self, pkg, pkg_info):