public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/binhost/
@ 2017-11-21 20:10 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2017-11-21 20:10 UTC (permalink / raw
  To: gentoo-commits

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 = []


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/binhost/
@ 2018-04-13  1:14 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2018-04-13  1:14 UTC (permalink / raw
  To: gentoo-commits

commit:     8b8322c4920052543436ca187b27649e6abb458f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 13 00:35:44 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 13 00:35:44 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8b8322c4

emaint binhost: update Packages header

 pym/portage/emaint/modules/binhost/binhost.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/portage/emaint/modules/binhost/binhost.py b/pym/portage/emaint/modules/binhost/binhost.py
index 1c9006386..d3df0cbce 100644
--- a/pym/portage/emaint/modules/binhost/binhost.py
+++ b/pym/portage/emaint/modules/binhost/binhost.py
@@ -170,6 +170,7 @@ class BinhostHandler(object):
 
 				del pkgindex.packages[:]
 				pkgindex.packages.extend(metadata.values())
+				bintree._update_pkgindex_header(self._pkgindex.header)
 				bintree._pkgindex_write(self._pkgindex)
 
 			finally:


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-13  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21 20:10 [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/binhost/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2018-04-13  1:14 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox