From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C6501138A1A for ; Wed, 18 Feb 2015 03:07:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F0B0DE0924; Wed, 18 Feb 2015 03:06:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7A99BE0922 for ; Wed, 18 Feb 2015 03:06:27 +0000 (UTC) Received: from x51r2.gaikai.org (unknown [100.42.98.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 7E302340876; Wed, 18 Feb 2015 03:06:21 +0000 (UTC) From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org Cc: Zac Medico Subject: [gentoo-portage-dev] [PATCH 5/7] binpkg-multi-instance 5 of 7 Date: Tue, 17 Feb 2015 19:05:43 -0800 Message-Id: <1424228745-7794-6-git-send-email-zmedico@gentoo.org> X-Mailer: git-send-email 2.0.5 In-Reply-To: <1424228745-7794-1-git-send-email-zmedico@gentoo.org> References: <20150217115607.0eccc56a.dolsen@gentoo.org> <1424228745-7794-1-git-send-email-zmedico@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: d01690d8-6e75-4008-aefc-a265f97e73e9 X-Archives-Hash: 68b1655c887dba823f1280ab107e68f5 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. --- pym/portage/dbapi/bintree.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 460b9f7..5636a5f 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, -- 2.0.5