From: Zac Medico Date: Thu, 6 Jul 2006 19:54:45 +0000 (-0000) Subject: Only commit the mtimedb if the internal state has changed. X-Git-Tag: v2.1.1~270 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32760f0803256ce12568689e7d577fbf66eecfed;p=portage.git Only commit the mtimedb if the internal state has changed. svn path=/main/trunk/; revision=3807 --- diff --git a/pym/portage.py b/pym/portage.py index 72b42dffc..6061695fa 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7127,9 +7127,15 @@ class MtimeDB(dict): writemsg("Deleting invalid mtimedb key: %s\n" % str(k)) del d[k] self.update(d) + self._clean_data = d def commit(self): - commit_mtimedb(mydict=self, filename=self.filename) + d = {} + d.update(self) + # Only commit if the internal state has changed. + if d != self._clean_data: + commit_mtimedb(mydict=d, filename=self.filename) + self._clean_data = d def create_trees(config_root="/", target_root="/", trees=None): if trees is None: