summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-07 11:22:40 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-07 11:22:40 +0000
commita2f0fbf76c63abc482a6e6586670327aa9ac4585 (patch)
tree3e4d495c134f605c524e876296c721815b18c224
parent3266963ed0bff7c1d65d9636786b8f03f828c9c9 (diff)
downloadportage-a2f0fbf76c63abc482a6e6586670327aa9ac4585.tar.gz
portage-a2f0fbf76c63abc482a6e6586670327aa9ac4585.tar.bz2
portage-a2f0fbf76c63abc482a6e6586670327aa9ac4585.zip
Fix a bug in vardbapi.removeFromContents() which sometimes prevents the
CONTENTS from being updated when it should. svn path=/main/trunk/; revision=11341
-rw-r--r--pym/portage/dbapi/vartree.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 8d40c24be..e59571173 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -942,7 +942,7 @@ class vardbapi(dbapi):
root = self.root
root_len = len(root) - 1
new_contents = pkg.getcontents().copy()
- contents_key = None
+ removed = 0
for filename in paths:
filename = normalize_path(filename)
@@ -953,8 +953,9 @@ class vardbapi(dbapi):
contents_key = pkg._match_contents(relative_filename, root)
if contents_key:
del new_contents[contents_key]
+ removed += 1
- if contents_key:
+ if removed:
f = atomic_ofstream(os.path.join(pkg.dbdir, "CONTENTS"))
write_contents(new_contents, root, f)
f.close()