diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-07-06 19:54:45 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-07-06 19:54:45 +0000 |
commit | 32760f0803256ce12568689e7d577fbf66eecfed (patch) | |
tree | 357a41a7ec7822d3ff9cefde43e15641b3578ea6 | |
parent | 1c2275ddd6d1149008c9f8b23f158b84dabc8186 (diff) | |
download | portage-32760f0803256ce12568689e7d577fbf66eecfed.tar.gz portage-32760f0803256ce12568689e7d577fbf66eecfed.tar.bz2 portage-32760f0803256ce12568689e7d577fbf66eecfed.zip |
Only commit the mtimedb if the internal state has changed.
svn path=/main/trunk/; revision=3807
-rw-r--r-- | pym/portage.py | 8 |
1 files changed, 7 insertions, 1 deletions
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: |