aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2015-02-17 18:20:17 -0800
committerZac Medico <zmedico@gentoo.org>2015-03-04 13:32:07 -0800
commitcc5abc989dc6adf31f4caf377cf0761a9431ed2b (patch)
tree19f42b5bbc9acd333774b273d209f6f834c140ca
parentbinpkg-multi-instance 4 of 7 (diff)
downloadportage-cc5abc989dc6adf31f4caf377cf0761a9431ed2b.tar.gz
portage-cc5abc989dc6adf31f4caf377cf0761a9431ed2b.tar.bz2
portage-cc5abc989dc6adf31f4caf377cf0761a9431ed2b.zip
binpkg-multi-instance 5 of 7
Remove unused bintree _pkgindex_cpv_map_latest_build function. This function is used by binhost clients running older versions of portage to select the latest builds when their binhost server switches to FEATURES=binpkg-multi-instance. The function is now unused because portage is now capable of examining multiple builds and it sorts them by BUILD_TIME in order to ensure that the latest builds are preferred when appropriate.
-rw-r--r--pym/portage/dbapi/bintree.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 9bc5d98ec..f5e7303d4 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -261,48 +261,6 @@ class bindbapi(fakedbapi):
return filesdict
-def _pkgindex_cpv_map_latest_build(pkgindex):
- """
- Given a PackageIndex instance, create a dict of cpv -> metadata map.
- If multiple packages have identical CPV values, prefer the package
- with latest BUILD_TIME value.
- @param pkgindex: A PackageIndex instance.
- @type pkgindex: PackageIndex
- @rtype: dict
- @return: a dict containing entry for the give cpv.
- """
- cpv_map = {}
-
- for d in pkgindex.packages:
- cpv = d["CPV"]
-
- try:
- cpv = _pkg_str(cpv)
- except InvalidData:
- writemsg(_("!!! Invalid remote binary package: %s\n") % cpv,
- noiselevel=-1)
- continue
-
- btime = d.get('BUILD_TIME', '')
- try:
- btime = int(btime)
- except ValueError:
- btime = None
-
- other_d = cpv_map.get(cpv)
- if other_d is not None:
- other_btime = other_d.get('BUILD_TIME', '')
- try:
- other_btime = int(other_btime)
- except ValueError:
- other_btime = None
- if other_btime and (not btime or other_btime > btime):
- continue
-
- cpv_map[_pkg_str(cpv)] = d
-
- return cpv_map
-
class binarytree(object):
"this tree scans for a list of all packages available in PKGDIR"
def __init__(self, _unused=DeprecationWarning, pkgdir=None,