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 1STiqA-0000B6-2f for garchives@archives.gentoo.org; Mon, 14 May 2012 00:08:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1CCB3E075F; Mon, 14 May 2012 00:08:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CE16FE075F for ; Mon, 14 May 2012 00:08:34 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1E57B1B406B for ; Mon, 14 May 2012 00:08:34 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D4045E5429 for ; Mon, 14 May 2012 00:08:32 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1336954097.d76df09c56687a58581dc279d4f6e37a95acfb9b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dep/dep_check.py X-VCS-Directories: pym/portage/dep/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d76df09c56687a58581dc279d4f6e37a95acfb9b X-VCS-Branch: master Date: Mon, 14 May 2012 00:08:32 +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: 8452cd80-5071-427b-9af1-5de1498e2b7a X-Archives-Hash: b94b8348f6639886bd4031934a2c67e1 commit: d76df09c56687a58581dc279d4f6e37a95acfb9b Author: Zac Medico gentoo org> AuthorDate: Mon May 14 00:08:17 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon May 14 00:08:17 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dd76df09c dep_check: use _pkg_str + vercmp, not pkgcmp --- pym/portage/dep/dep_check.py | 36 +++++++++++++++++++++--------------- 1 files changed, 21 insertions(+), 15 deletions(-) diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 0866673..99a5eb0 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -1,4 +1,4 @@ -# Copyright 2010-2011 Gentoo Foundation +# Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 __all__ =3D ['dep_check', 'dep_eval', 'dep_wordreduce', 'dep_zapdeps'] @@ -11,7 +11,7 @@ from portage.dep import Atom, match_from_list, use_redu= ce from portage.exception import InvalidDependString, ParseError from portage.localization import _ from portage.util import writemsg, writemsg_level -from portage.versions import catpkgsplit, cpv_getkey, pkgcmp +from portage.versions import vercmp, _pkg_str =20 def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot=3D= "/", trees=3DNone, use_mask=3DNone, use_force=3DNone, **kwargs): @@ -39,14 +39,12 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, my= settings, myroot=3D"/", parent =3D mytrees.get("parent") virt_parent =3D mytrees.get("virt_parent") graph_parent =3D None - eapi =3D None if parent is not None: if virt_parent is not None: graph_parent =3D virt_parent parent =3D virt_parent else: graph_parent =3D parent - eapi =3D parent.metadata["EAPI"] repoman =3D not mysettings.local_config if kwargs["use_binaries"]: portdb =3D trees[myroot]["bintree"].dbapi @@ -352,8 +350,14 @@ def dep_zapdeps(unreduced, reduced, myroot, use_bina= ries=3D0, trees=3DNone): avail_pkg =3D mydbapi.match(atom.without_use) if avail_pkg: avail_pkg =3D avail_pkg[-1] # highest (ascending order) - avail_slot =3D Atom("%s:%s" % (atom.cp, - mydbapi.aux_get(avail_pkg, ["SLOT"])[0])) + try: + slot =3D avail_pkg.slot + except AttributeError: + eapi, slot, repo =3D mydbapi.aux_get(avail_pkg, + ["EAPI", "SLOT", "repository"]) + avail_pkg =3D _pkg_str(avail_pkg, eapi=3Deapi, + slot=3Dslot, repo=3Drepo) + avail_slot =3D Atom("%s:%s" % (atom.cp, slot)) if not avail_pkg: all_available =3D False all_use_satisfied =3D False @@ -368,16 +372,19 @@ def dep_zapdeps(unreduced, reduced, myroot, use_bin= aries=3D0, trees=3DNone): avail_pkg_use =3D avail_pkg_use[-1] if avail_pkg_use !=3D avail_pkg: avail_pkg =3D avail_pkg_use - avail_slot =3D Atom("%s:%s" % (atom.cp, - mydbapi.aux_get(avail_pkg, ["SLOT"])[0])) + try: + slot =3D avail_pkg.slot + except AttributeError: + eapi, slot, repo =3D mydbapi.aux_get(avail_pkg, + ["EAPI", "SLOT", "repository"]) + avail_pkg =3D _pkg_str(avail_pkg, + eapi=3Deapi, slot=3Dslot, repo=3Drepo) =20 slot_map[avail_slot] =3D avail_pkg - pkg_cp =3D cpv_getkey(avail_pkg) - highest_cpv =3D cp_map.get(pkg_cp) + highest_cpv =3D cp_map.get(avail_pkg.cp) if highest_cpv is None or \ - pkgcmp(catpkgsplit(avail_pkg)[1:], - catpkgsplit(highest_cpv)[1:]) > 0: - cp_map[pkg_cp] =3D avail_pkg + vercmp(avail_pkg.version, highest_cpv.version) > 0: + cp_map[avail_pkg.cp] =3D avail_pkg =20 this_choice =3D (atoms, slot_map, cp_map, all_available) if all_available: @@ -515,8 +522,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binar= ies=3D0, trees=3DNone): for cp in intersecting_cps: version_1 =3D cp_map_1[cp] version_2 =3D cp_map_2[cp] - difference =3D pkgcmp(catpkgsplit(version_1)[1:], - catpkgsplit(version_2)[1:]) + difference =3D vercmp(version_1.version, version_2.version) if difference !=3D 0: if difference > 0: has_upgrade =3D True