diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-04-10 06:04:10 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-04-10 06:04:10 +0000 |
commit | d67222fbc42ec341d3368056b1f6134cdffa2d01 (patch) | |
tree | 1728fc3ca0e5310c0dc39ca8dbf78e35283dbb86 /pym | |
parent | dd42a8655f7f60d538f1cc480c530ebfde339bdf (diff) | |
download | portage-d67222fbc42ec341d3368056b1f6134cdffa2d01.tar.gz portage-d67222fbc42ec341d3368056b1f6134cdffa2d01.tar.bz2 portage-d67222fbc42ec341d3368056b1f6134cdffa2d01.zip |
Efficiently recycle partial valid vdb cache when possible. This reduces disk load when switching between versions of portage that cache different keys. (trunk r6359:6360)
svn path=/main/branches/2.1.2/; revision=6361
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py index b61b4e22f..ebf7e3463 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5303,13 +5303,16 @@ class vardbapi(dbapi): if pkg_data: cache_mtime, metadata = pkg_data cache_valid = cache_mtime == mydir_mtime - if cache_valid and set(metadata) != self._aux_cache_keys: + if cache_valid: + cache_incomplete = self._aux_cache_keys.difference(metadata) + if cache_incomplete: # Allow self._aux_cache_keys to change without a cache version - # bump. + # bump and efficiently recycle partial cache whenever possible. cache_valid = False - if cache_valid: + pull_me = cache_incomplete.union(wants) + else: + pull_me = set(wants).difference(self._aux_cache_keys) mydata.update(metadata) - pull_me = set(wants).difference(self._aux_cache_keys) else: pull_me = self._aux_cache_keys.union(wants) if pull_me: |