aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2017-11-21 12:05:50 -0800
committerZac Medico <zmedico@gentoo.org>2017-11-21 12:08:13 -0800
commitb1d467ad9984c8fb100aeccb7de084f395a099f4 (patch)
treed06844e17f70968704a84f8e28b3ed2f220ff737
parentbinarytree.populate: avoid unnecessary index re-write (bug 638292) (diff)
downloadportage-b1d467ad9984c8fb100aeccb7de084f395a099f4.tar.gz
portage-b1d467ad9984c8fb100aeccb7de084f395a099f4.tar.bz2
portage-b1d467ad9984c8fb100aeccb7de084f395a099f4.zip
emaint binhost: use _populate_local return value when appropriate
Since _populate_local does not write the Packages file to disk, its return value must be used because _load_pkgindex would return stale data. Fixes: 694419fc11af ("emaint binhost: use _populate_local instead of _populate (bug 638320)") Bug: https://bugs.gentoo.org/638320
-rw-r--r--pym/portage/emaint/modules/binhost/binhost.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/portage/emaint/modules/binhost/binhost.py b/pym/portage/emaint/modules/binhost/binhost.py
index f18878c7c..1c9006386 100644
--- a/pym/portage/emaint/modules/binhost/binhost.py
+++ b/pym/portage/emaint/modules/binhost/binhost.py
@@ -122,14 +122,14 @@ class BinhostHandler(object):
pkgindex_lock = locks.lockfile(
self._pkgindex_file, wantnewlockfile=1)
try:
- # Repopulate with lock held.
- bintree._populate_local()
+ # Repopulate with lock held. If _populate_local returns
+ # data then use that, since _load_pkgindex would return
+ # stale data in this case.
+ self._pkgindex = pkgindex = (bintree._populate_local() or
+ bintree._load_pkgindex())
cpv_all = self._bintree.dbapi.cpv_all()
cpv_all.sort()
- pkgindex = bintree._load_pkgindex()
- self._pkgindex = pkgindex
-
# Recount stale/missing packages, with lock held.
missing = []
stale = []