diff options
-rw-r--r-- | pym/portage/dbapi/bintree.py | 19 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 12 |
2 files changed, 16 insertions, 15 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 76447bf61..e6ea40347 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -2,6 +2,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +from __future__ import print_function + __all__ = ["bindbapi", "binarytree"] import portage @@ -238,20 +240,19 @@ class binarytree(object): for atom in (origcp, newcp): if not isjustname(atom): raise InvalidPackageName(str(atom)) - origcat = origcp.split("/")[0] - mynewcat = newcp.split("/")[0] + mynewcat = catsplit(newcp)[0] origmatches=self.dbapi.cp_list(origcp) moves = 0 if not origmatches: return moves for mycpv in origmatches: - - mycpsplit = catpkgsplit(mycpv) - mynewcpv = newcp + "-" + mycpsplit[2] - if mycpsplit[3] != "r0": - mynewcpv += "-" + mycpsplit[3] - myoldpkg = mycpv.split("/")[1] - mynewpkg = mynewcpv.split("/")[1] + mycpv_cp = portage.cpv_getkey(mycpv) + if mycpv_cp != origcp: + # Ignore PROVIDE virtual match. + continue + mynewcpv = mycpv.replace(mycpv_cp, str(newcp), 1) + myoldpkg = catsplit(mycpv)[1] + mynewpkg = catsplit(mynewcpv)[1] if (mynewpkg != myoldpkg) and os.path.exists(self.getname(mynewcpv)): writemsg(_("!!! Cannot update binary: Destination exists.\n"), diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index d2160896e..90d27dee3 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -892,12 +892,12 @@ class vardbapi(dbapi): if not origmatches: return moves for mycpv in origmatches: - mycpsplit = catpkgsplit(mycpv) - mynewcpv = newcp + "-" + mycpsplit[2] - mynewcat = newcp.split("/")[0] - if mycpsplit[3] != "r0": - mynewcpv += "-" + mycpsplit[3] - mycpsplit_new = catpkgsplit(mynewcpv) + mycpv_cp = cpv_getkey(mycpv) + if mycpv_cp != origcp: + # Ignore PROVIDE virtual match. + continue + mynewcpv = mycpv.replace(mycpv_cp, str(newcp), 1) + mynewcat = catsplit(newcp)[0] origpath = self.getpath(mycpv) if not os.path.exists(origpath): continue |