From: Zac Medico Date: Thu, 7 Aug 2008 11:22:40 +0000 (-0000) Subject: Fix a bug in vardbapi.removeFromContents() which sometimes prevents the X-Git-Tag: v2.2_rc7~41 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a2f0fbf76c63abc482a6e6586670327aa9ac4585;p=portage.git Fix a bug in vardbapi.removeFromContents() which sometimes prevents the CONTENTS from being updated when it should. svn path=/main/trunk/; revision=11341 --- 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()