From 32760f0803256ce12568689e7d577fbf66eecfed Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 6 Jul 2006 19:54:45 +0000 Subject: [PATCH] Only commit the mtimedb if the internal state has changed. svn path=/main/trunk/; revision=3807 --- pym/portage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: -- 2.26.2