From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Pr9mG-0005lh-NV for garchives@archives.gentoo.org; Sun, 20 Feb 2011 13:56:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A7D91C016; Sun, 20 Feb 2011 13:56:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1CBC71C016 for ; Sun, 20 Feb 2011 13:56:37 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 82B121B4129 for ; Sun, 20 Feb 2011 13:56:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id ECB918006A for ; Sun, 20 Feb 2011 13:56:35 +0000 (UTC) From: "Tomas Chvatal" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tomas Chvatal" Message-ID: Subject: [gentoo-commits] proj/gentoo-bumpchecker:master commit in: modules/ X-VCS-Repository: proj/gentoo-bumpchecker X-VCS-Files: modules/portage_module.py X-VCS-Directories: modules/ X-VCS-Committer: scarabeus X-VCS-Committer-Name: Tomas Chvatal X-VCS-Revision: be54c034a8cc6c4ed064797d346e4659aebe4b29 Date: Sun, 20 Feb 2011 13:56:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 0e4f5e89fd6a4577bb21d2f235f4e33e commit: be54c034a8cc6c4ed064797d346e4659aebe4b29 Author: Tomas Chvatal gentoo org> AuthorDate: Sun Feb 20 13:56:28 2011 +0000 Commit: Tomas Chvatal gentoo org> CommitDate: Sun Feb 20 13:56:28 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoo-bumpch= ecker.git;a=3Dcommit;h=3Dbe54c034 Cleanup the mess in portage_module. God we really need to rewrite this to= ol... --- modules/portage_module.py | 47 ++++++++-------------------------------= ----- 1 files changed, 9 insertions(+), 38 deletions(-) diff --git a/modules/portage_module.py b/modules/portage_module.py index eb2243a..2d2b7d7 100644 --- a/modules/portage_module.py +++ b/modules/portage_module.py @@ -69,9 +69,6 @@ def best_version_test(package1, package2): # having the overhead of calling it each time and getting the output. def find_latest_package_in_tree(package_name, portdbapi=3DNone): try: - if portdbapi is None: - portdbapi =3D portage.db['/'][get_dbtree()].dbapi - mylist =3D portdbapi.match(package_name) return portage.best(mylist) except KeyError: @@ -83,42 +80,25 @@ def find_packages_in_tree(package_list, portdir=3DNon= e, all_overlays=3DFalse, overla #overlays =3D ["/home/allanon/cvs/gnome"] =20 portage_versions =3D [] - portdbsettings =3D portage.db['/'][get_dbtree()].settings - portdbapi =3D portage.db['/'][get_dbtree()].dbapi =20 - old_dbapi =3D None - olddbapi_kw =3D None + if all_overlays is False: + overlays =3D '' + if overlay_list is not None: + overlays =3D overlay_list =20 if stable is not False: # stable - mysettings =3D portage.config(clone=3Dportdbsettings) - mysettings['ACCEPT_KEYWORDS'] =3D 'amd64' # the arch I care for = :] - olddbapi_kw =3D portdbapi - portdbapi =3D portage.portdbapi(mysettings['PORTDIR'], mysetting= s=3Dmysettings) + keywords =3D 'amd64' # the arch I care for :] else: #testing - mysettings =3D portage.config(clone=3Dportdbsettings) - mysettings['ACCEPT_KEYWORDS'] =3D 'amd64 ~amd64' # the arch I ca= re for :] - olddbapi_kw =3D portdbapi - portdbapi =3D portage.portdbapi(mysettings['PORTDIR'], mysetting= s=3Dmysettings) + keywords =3D 'amd64 ~amd64' # the arch I care for :] =20 if portdir is not None: - mysettings =3D portage.config(clone=3Dportdbsettings) - mysettings['PORTDIR'] =3D portdir - olddbapi =3D portdbapi - portdbapi =3D portage.portdbapi(mysettings['PORTDIR']) + mysettings =3D portage.config(env=3D{'PORTDIR_OVERLAY': overlays= , 'KEYWORDS': keywords, 'PORTDIR': portdir}) else: - portdir =3D portdbsettings['PORTDIR'] + mysettings =3D portage.config(env=3D{'PORTDIR_OVERLAY': overlays= , 'KEYWORDS': keywords}) =20 - if all_overlays is False: - # Prune list of trees to be scanned - oldporttrees =3D portdbapi.porttrees - portdbapi.porttrees =3D [os.path.realpath(portdir)] - - # Now append the overlays we want. First resolve to absolute pat= hs. - if overlay_list is not None: - portdbapi.porttrees +=3D \ - [ os.path.realpath(overlay) for overlay in overlay_l= ist ] + portdbapi =3D portage.portdbapi(mysettings=3Dmysettings) =20 for package in package_list: best_package =3D find_latest_package_in_tree(package.name, portd= bapi) @@ -129,15 +109,6 @@ def find_packages_in_tree(package_list, portdir=3DNo= ne, all_overlays=3DFalse, overla # Need to account for slotted packages here portage_versions.append(package_module.Package(best_package)= ) =20 - # Restore portdb trees list - if all_overlays is False: - portdbapi.porttrees =3D oldporttrees - - if olddbapi_kw is not None: - portage.dbapi =3D olddbapi_kw - if old_dbapi is not None: - portage.dbapi =3D old_dbapi - return portage_versions =20 def tests():