Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH 5/7] binpkg-multi-instance 5 of 7
Date: Wed, 18 Feb 2015 03:07:18
Message-Id: 1424228745-7794-6-git-send-email-zmedico@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 0/7] Add FEATURES=binpkg-multi-instance (bug 150031) by Zac Medico
1 Remove unused bintree _pkgindex_cpv_map_latest_build function. This
2 function is used by binhost clients running older versions of portage
3 to select the latest builds when their binhost server switches to
4 FEATURES=binpkg-multi-instance. The function is now unused because
5 portage is now capable of examining multiple builds and it sorts them
6 by BUILD_TIME in order to ensure that the latest builds are preferred
7 when appropriate.
8 ---
9 pym/portage/dbapi/bintree.py | 42 ------------------------------------------
10 1 file changed, 42 deletions(-)
11
12 diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
13 index 460b9f7..5636a5f 100644
14 --- a/pym/portage/dbapi/bintree.py
15 +++ b/pym/portage/dbapi/bintree.py
16 @@ -261,48 +261,6 @@ class bindbapi(fakedbapi):
17
18 return filesdict
19
20 -def _pkgindex_cpv_map_latest_build(pkgindex):
21 - """
22 - Given a PackageIndex instance, create a dict of cpv -> metadata map.
23 - If multiple packages have identical CPV values, prefer the package
24 - with latest BUILD_TIME value.
25 - @param pkgindex: A PackageIndex instance.
26 - @type pkgindex: PackageIndex
27 - @rtype: dict
28 - @return: a dict containing entry for the give cpv.
29 - """
30 - cpv_map = {}
31 -
32 - for d in pkgindex.packages:
33 - cpv = d["CPV"]
34 -
35 - try:
36 - cpv = _pkg_str(cpv)
37 - except InvalidData:
38 - writemsg(_("!!! Invalid remote binary package: %s\n") % cpv,
39 - noiselevel=-1)
40 - continue
41 -
42 - btime = d.get('BUILD_TIME', '')
43 - try:
44 - btime = int(btime)
45 - except ValueError:
46 - btime = None
47 -
48 - other_d = cpv_map.get(cpv)
49 - if other_d is not None:
50 - other_btime = other_d.get('BUILD_TIME', '')
51 - try:
52 - other_btime = int(other_btime)
53 - except ValueError:
54 - other_btime = None
55 - if other_btime and (not btime or other_btime > btime):
56 - continue
57 -
58 - cpv_map[_pkg_str(cpv)] = d
59 -
60 - return cpv_map
61 -
62 class binarytree(object):
63 "this tree scans for a list of all packages available in PKGDIR"
64 def __init__(self, _unused=DeprecationWarning, pkgdir=None,
65 --
66 2.0.5