summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-09 21:05:28 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-09 21:05:28 +0000
commit5bae27f6ea2842af68ea09f63168cc8dc1029b0c (patch)
tree457980a871627c9c55f832cf929d46023e0fff17
parent0a33c899712fd43bcad71bb194b3208157236b65 (diff)
downloadportage-5bae27f6ea2842af68ea09f63168cc8dc1029b0c.tar.gz
portage-5bae27f6ea2842af68ea09f63168cc8dc1029b0c.tar.bz2
portage-5bae27f6ea2842af68ea09f63168cc8dc1029b0c.zip
Add a bindbapi.aux_update() method for database maintenance. See bug #122089.
svn path=/main/trunk/; revision=3825
-rw-r--r--pym/portage.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 1372ecb4e..01a59726f 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4273,6 +4273,18 @@ class bindbapi(fakedbapi):
mylist[idx] = "0"
return mylist
+ def aux_update(self, cpv, values):
+ tbz2path = self.bintree.getname(cpv)
+ mylock = portage_locks.lockfile(tbz2path, wantnewlockfile=1)
+ try:
+ if not os.path.exists(tbz2path):
+ raise KeyError(cpv)
+ mytbz2 = xpak.tbz2(tbz2path)
+ mydata = mytbz2.get_data()
+ mydata.update(values)
+ mytbz2.recompose_mem(xpak.xpak_mem(mydata))
+ finally:
+ portage_locks.unlockfile(mylock)
cptot=0
class vardbapi(dbapi):