emaint: fix MoveHandler for EAPI 5 sub-slot
authorZac Medico <zmedico@gentoo.org>
Thu, 18 Oct 2012 04:06:00 +0000 (21:06 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 18 Oct 2012 04:06:00 +0000 (21:06 -0700)
pym/portage/emaint/modules/move/move.py

index 29ff3300519647351930e1a386ee1be2fa0733ce..e05076bc3e5f3133fa0fb5972a27c079ddf4e033 100644 (file)
@@ -48,6 +48,7 @@ class MoveHandler(object):
                # progress bar is updated in indeterminate mode.
                match = self._tree.dbapi.match
                aux_get = self._tree.dbapi.aux_get
+               pkg_str = self._tree.dbapi._pkg_str
                if onProgress:
                        onProgress(0, 0)
                for repo, updates in allupdates.items():
@@ -65,13 +66,14 @@ class MoveHandler(object):
                                if update_cmd[0] == "move":
                                        origcp, newcp = update_cmd[1:]
                                        for cpv in match(origcp):
-                                               if repo_match(aux_get(cpv, ["repository"])[0]):
+                                               cpv = pkg_str(cpv, None)
+                                               if repo_match(cpv.repo):
                                                        errors.append("'%s' moved to '%s'" % (cpv, newcp))
                                elif update_cmd[0] == "slotmove":
                                        pkg, origslot, newslot = update_cmd[1:]
                                        for cpv in match(pkg):
-                                               slot, prepo = aux_get(cpv, ["SLOT", "repository"])
-                                               if slot == origslot and repo_match(prepo):
+                                               cpv = pkg_str(cpv, None)
+                                               if cpv.slot == origslot and repo_match(cpv.repo):
                                                        errors.append("'%s' slot moved from '%s' to '%s'" % \
                                                                (cpv, origslot, newslot))
                                if onProgress: