public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/binhost/
Date: Tue, 21 Nov 2017 20:10:50 +0000 (UTC)	[thread overview]
Message-ID: <1511294893.b1d467ad9984c8fb100aeccb7de084f395a099f4.zmedico@gentoo> (raw)

commit:     b1d467ad9984c8fb100aeccb7de084f395a099f4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 21 20:05:50 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov 21 20:08:13 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b1d467ad

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

 pym/portage/emaint/modules/binhost/binhost.py | 10 +++++-----
 1 file 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 = []


             reply	other threads:[~2017-11-21 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 20:10 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-13  1:14 [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/binhost/ Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511294893.b1d467ad9984c8fb100aeccb7de084f395a099f4.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox