diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-07-09 21:05:28 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-07-09 21:05:28 +0000 |
commit | 5bae27f6ea2842af68ea09f63168cc8dc1029b0c (patch) | |
tree | 457980a871627c9c55f832cf929d46023e0fff17 | |
parent | 0a33c899712fd43bcad71bb194b3208157236b65 (diff) | |
download | portage-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.py | 12 |
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): |