Simplify code for derived Package attributes.
authorZac Medico <zmedico@gentoo.org>
Fri, 9 May 2008 08:45:05 +0000 (08:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 May 2008 08:45:05 +0000 (08:45 -0000)
svn path=/main/trunk/; revision=10266

pym/_emerge/__init__.py

index bd013fa61881314cf0c8a7835e7a86df9aa7a315..43af8058b94916385f0ed807e0c0c87d9a27e7a9 100644 (file)
@@ -1285,10 +1285,8 @@ class Package(Task):
                self.cp = portage.cpv_getkey(self.cpv)
                self.slot_atom = "%s:%s" % (self.cp, self.metadata["SLOT"])
                self.cpv_slot = "%s:%s" % (self.cpv, self.metadata["SLOT"])
-               cpv_parts = portage.catpkgsplit(self.cpv)
-               self.category = cpv_parts[0]
-               self.pv_split = cpv_parts[1:]
-               self.pf = self.cpv.replace(self.category + "/", "", 1)
+               self.category, self.pf = portage.catsplit(self.cpv)
+               self.pv_split = portage.catpkgsplit(self.cpv)[1:]
 
        def _get_hash_key(self):
                hash_key = getattr(self, "_hash_key", None)