summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-31 07:00:45 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-31 07:00:45 +0000
commit7255572e21e1e017266da3888648c172a63870f7 (patch)
treefc30a63ac949fb9a0c4ebea079e5c3b949134642 /pym/portage/dbapi/__init__.py
parentf50684e83a2a3ef71556e276d03534a5d9bbb500 (diff)
downloadportage-7255572e21e1e017266da3888648c172a63870f7.tar.gz
portage-7255572e21e1e017266da3888648c172a63870f7.tar.bz2
portage-7255572e21e1e017266da3888648c172a63870f7.zip
Create one unified dbapi.move_slot_ent() method to replace the corresponding binarytree and vardbapi methods.
svn path=/main/trunk/; revision=6688
Diffstat (limited to 'pym/portage/dbapi/__init__.py')
-rw-r--r--pym/portage/dbapi/__init__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index fce395b00..ef91d4de1 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -78,3 +78,21 @@ class dbapi(object):
aux_update(cpv, metadata_updates)
if onProgress:
onProgress(maxval, i+1)
+
+ def move_slot_ent(self, mylist):
+ pkg = mylist[1]
+ origslot = mylist[2]
+ newslot = mylist[3]
+ origmatches = self.match(pkg)
+ moves = 0
+ if not origmatches:
+ return moves
+ from portage.versions import catsplit
+ for mycpv in origmatches:
+ slot = self.aux_get(mycpv, ["SLOT"])[0]
+ if slot != origslot:
+ continue
+ moves += 1
+ mydata = {"SLOT": newslot+"\n"}
+ self.aux_update(mycpv, mydata)
+ return moves