diff options
-rw-r--r-- | pym/portage/dbapi/bintree.py | 3 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index b8a24e515..94704e455 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -77,6 +77,9 @@ class bindbapi(fakedbapi): mytbz2 = portage.xpak.tbz2(tbz2path) mydata = mytbz2.get_data() mydata.update(values) + for k, v in mydata.items(): + if not v: + del mydata[k] mytbz2.recompose_mem(portage.xpak.xpak_mem(mydata)) def cp_list(self, *pargs, **kwargs): diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 23676c91b..165e04f1e 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -551,7 +551,13 @@ class vardbapi(dbapi): if not mylink.exists(): raise KeyError(cpv) for k, v in values.iteritems(): - mylink.setfile(k, v) + if v: + mylink.setfile(k, v) + else: + try: + os.unlink(os.path.join(self.getpath(cpv), k)) + except EnvironmentError: + pass def counter_tick(self, myroot, mycpv=None): return self.counter_tick_core(myroot, incrementing=1, mycpv=mycpv) |