aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2017-11-21 11:22:21 -0800
committerZac Medico <zmedico@gentoo.org>2017-11-21 11:27:17 -0800
commitca300d4fccffb8cd3d0d12f60c7c8c368f049258 (patch)
treeb86832e297def6a8a9101ff8f0a6f58fc7b2f007
parentemaint binhost: use _populate_local instead of _populate (bug 638320) (diff)
downloadportage-ca300d4fccffb8cd3d0d12f60c7c8c368f049258.tar.gz
portage-ca300d4fccffb8cd3d0d12f60c7c8c368f049258.tar.bz2
portage-ca300d4fccffb8cd3d0d12f60c7c8c368f049258.zip
binarytree.populate: avoid unnecessary index re-write (bug 638292)
Exclude hashes from the minimum_keys, so that the Packages index will not be needlessly re-written due to missing digests. Bug: https://bugs.gentoo.org/638292
-rw-r--r--pym/portage/dbapi/bintree.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index f4e8a1c66..201666c41 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -569,6 +569,11 @@ class binarytree(object):
def _populate_local(self):
self.dbapi.clear()
_instance_key = self.dbapi._instance_key
+ # In order to minimize disk I/O, we never compute digests here.
+ # Therefore we exclude hashes from the minimum_keys, so that
+ # the Packages file will not be needlessly re-written due to
+ # missing digests.
+ minimum_keys = self._pkgindex_keys.difference(self._pkgindex_hashes)
if True:
pkg_paths = {}
self._pkg_paths = pkg_paths
@@ -631,7 +636,7 @@ class binarytree(object):
continue
except (KeyError, ValueError):
continue
- if not self._pkgindex_keys.difference(d):
+ if not minimum_keys.difference(d):
match = d
break
if match: