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 1QgHDc-0007H7-67 for garchives@archives.gentoo.org; Mon, 11 Jul 2011 14:12:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 777DF21C314; Mon, 11 Jul 2011 14:12:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3656B21C2ED for ; Mon, 11 Jul 2011 14:12:08 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 869471B4014 for ; Mon, 11 Jul 2011 14:12:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 859FA8003D for ; Mon, 11 Jul 2011 14:12:06 +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: <774ab66e9cc55f749052d690421765647c9c9c9c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/depgraph.py pym/_emerge/is_valid_package_atom.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 774ab66e9cc55f749052d690421765647c9c9c9c Date: Mon, 11 Jul 2011 14:12:06 +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: 805ba2c4f236cbff057861b26ef96c8b commit: 774ab66e9cc55f749052d690421765647c9c9c9c Author: Zac Medico gentoo org> AuthorDate: Mon Jul 11 14:08:30 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Jul 11 14:08:30 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D774ab66e is_valid_package_atom: fix circular import Due to a quirk in python import behavior, this only failed nondeterministically. However, the new preinst sanity test in the portage-9999 ebuild tends to trigger it more often for some people. --- pym/_emerge/depgraph.py | 13 ++----------- pym/_emerge/is_valid_package_atom.py | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index d0b8fb7..a4b04f6 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -7,7 +7,6 @@ import difflib import errno import io import logging -import re import stat import sys import textwrap @@ -49,7 +48,8 @@ from _emerge.DepPriorityNormalRange import DepPriorityN= ormalRange from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange from _emerge.FakeVartree import FakeVartree from _emerge._find_deep_system_runtime_deps import _find_deep_system_run= time_deps -from _emerge.is_valid_package_atom import is_valid_package_atom +from _emerge.is_valid_package_atom import insert_category_into_atom, \ + is_valid_package_atom from _emerge.Package import Package from _emerge.PackageArg import PackageArg from _emerge.PackageVirtualDbapi import PackageVirtualDbapi @@ -6690,15 +6690,6 @@ def ambiguous_package_name(arg, atoms, root_config= , spinner, myopts): writemsg("!!! The short ebuild name \"%s\" is ambiguous. Please specify= \n" % arg, noiselevel=3D-1) writemsg("!!! one of the above fully-qualified ebuild names instead.\n\= n", noiselevel=3D-1) =20 -def insert_category_into_atom(atom, category): - alphanum =3D re.search(r'\w', atom) - if alphanum: - ret =3D atom[:alphanum.start()] + "%s/" % category + \ - atom[alphanum.start():] - else: - ret =3D None - return ret - def _spinner_start(spinner, myopts): if spinner is None: return diff --git a/pym/_emerge/is_valid_package_atom.py b/pym/_emerge/is_valid_= package_atom.py index d33cf45..7cb2a5b 100644 --- a/pym/_emerge/is_valid_package_atom.py +++ b/pym/_emerge/is_valid_package_atom.py @@ -1,13 +1,21 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 import re -import portage -import _emerge.depgraph +from portage.dep import isvalidatom + +def insert_category_into_atom(atom, category): + alphanum =3D re.search(r'\w', atom) + if alphanum: + ret =3D atom[:alphanum.start()] + "%s/" % category + \ + atom[alphanum.start():] + else: + ret =3D None + return ret =20 def is_valid_package_atom(x, allow_repo=3DFalse): if "/" not in x: - x2 =3D _emerge.depgraph.insert_category_into_atom(x, 'cat') + x2 =3D insert_category_into_atom(x, 'cat') if x2 !=3D None: x =3D x2 - return portage.isvalidatom(x, allow_blockers=3DFalse, allow_repo=3Dallo= w_repo) + return isvalidatom(x, allow_blockers=3DFalse, allow_repo=3Dallow_repo)