From 5bae27f6ea2842af68ea09f63168cc8dc1029b0c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 9 Jul 2006 21:05:28 +0000 Subject: [PATCH] Add a bindbapi.aux_update() method for database maintenance. See bug #122089. svn path=/main/trunk/; revision=3825 --- pym/portage.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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): -- 2.26.2