summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-13 15:30:31 -0700
committerZac Medico <zmedico@gentoo.org>2012-05-13 15:30:31 -0700
commitba307ef1dc5ed986fa79fe732cc8d66820a901ef (patch)
treeec5db037a940d2ba979b22c23059a6b864ab5781
parent2209b21e0ee6c14f9293d589cf0ddba44ee816f4 (diff)
downloadportage-ba307ef1dc5ed986fa79fe732cc8d66820a901ef.tar.gz
portage-ba307ef1dc5ed986fa79fe732cc8d66820a901ef.tar.bz2
portage-ba307ef1dc5ed986fa79fe732cc8d66820a901ef.zip
_pkg_str: make version -r0 consistent with input
-rw-r--r--pym/portage/versions.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index 50eba56bd..298b7aaca 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -338,7 +338,10 @@ class _pkg_str(_unicode):
if self.cpv_split is None:
raise InvalidData(cpv)
self.__dict__['cp'] = self.cpv_split[0] + '/' + self.cpv_split[1]
- self.__dict__['version'] = "-".join(self.cpv_split[2:])
+ if self.cpv_split[-1] == "r0" and cpv[-3:] != "-r0":
+ self.__dict__['version'] = "-".join(self.cpv_split[2:-1])
+ else:
+ self.__dict__['version'] = "-".join(self.cpv_split[2:])
# for match_from_list introspection
self.__dict__['cpv'] = self
if slot is not None: