Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/binhost/
Date: Tue, 21 Nov 2017 20:10:54
Message-Id: 1511294893.b1d467ad9984c8fb100aeccb7de084f395a099f4.zmedico@gentoo
1 commit: b1d467ad9984c8fb100aeccb7de084f395a099f4
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 21 20:05:50 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 21 20:08:13 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b1d467ad
7
8 emaint binhost: use _populate_local return value when appropriate
9
10 Since _populate_local does not write the Packages file to disk,
11 its return value must be used because _load_pkgindex would return
12 stale data.
13
14 Fixes: 694419fc11af ("emaint binhost: use _populate_local instead of _populate (bug 638320)")
15 Bug: https://bugs.gentoo.org/638320
16
17 pym/portage/emaint/modules/binhost/binhost.py | 10 +++++-----
18 1 file changed, 5 insertions(+), 5 deletions(-)
19
20 diff --git a/pym/portage/emaint/modules/binhost/binhost.py b/pym/portage/emaint/modules/binhost/binhost.py
21 index f18878c7c..1c9006386 100644
22 --- a/pym/portage/emaint/modules/binhost/binhost.py
23 +++ b/pym/portage/emaint/modules/binhost/binhost.py
24 @@ -122,14 +122,14 @@ class BinhostHandler(object):
25 pkgindex_lock = locks.lockfile(
26 self._pkgindex_file, wantnewlockfile=1)
27 try:
28 - # Repopulate with lock held.
29 - bintree._populate_local()
30 + # Repopulate with lock held. If _populate_local returns
31 + # data then use that, since _load_pkgindex would return
32 + # stale data in this case.
33 + self._pkgindex = pkgindex = (bintree._populate_local() or
34 + bintree._load_pkgindex())
35 cpv_all = self._bintree.dbapi.cpv_all()
36 cpv_all.sort()
37
38 - pkgindex = bintree._load_pkgindex()
39 - self._pkgindex = pkgindex
40 -
41 # Recount stale/missing packages, with lock held.
42 missing = []
43 stale = []