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 1QUkHp-00012f-F1 for garchives@archives.gentoo.org; Thu, 09 Jun 2011 18:48:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 99E9A1C02F; Thu, 9 Jun 2011 18:48:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 630991C02F for ; Thu, 9 Jun 2011 18:48:49 +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 E34C91B401B for ; Thu, 9 Jun 2011 18:48:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 55D2B8003C for ; Thu, 9 Jun 2011 18:48:48 +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: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/portage/tests/dep/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dep/__init__.py pym/portage/tests/dep/test_use_reduce.py X-VCS-Directories: pym/portage/dep/ pym/portage/tests/dep/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d85506e8a37778e0935f43f9e7cc62bb8b933063 Date: Thu, 9 Jun 2011 18:48:48 +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: c00d1b4790829ecf1db71e1e7bf70213 commit: d85506e8a37778e0935f43f9e7cc62bb8b933063 Author: Zac Medico gentoo org> AuthorDate: Thu Jun 9 18:48:19 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Jun 9 18:48:19 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dd85506e8 useflag/dep_re: less strict if eapi None When eapi is None then validation is not as strict, since we want the same to work for multiple EAPIs that may have slightly different rules. --- pym/portage/dep/__init__.py | 19 +++++++++++++++---- pym/portage/tests/dep/test_use_reduce.py | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index ba37324..b9020a7 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -641,13 +641,15 @@ _usedep_re =3D { =20 def _get_usedep_re(eapi): """ + When eapi is None then validation is not as strict, since we want the + same to work for multiple EAPIs that may have slightly different rules. @param eapi: The EAPI @type eapi: String or None @rtype: regular expression object - @return: A regular expression object that matches valid USE flags for t= he - given eapi. If eapi is None then the latest supported EAPI is assumed. + @return: A regular expression object that matches valid USE deps for th= e + given eapi. """ - if eapi in ("4-python",): + if eapi in (None, "4-python",): return _usedep_re["4-python"] else: return _usedep_re["0"] @@ -1625,7 +1627,16 @@ _useflag_re =3D { } =20 def _get_useflag_re(eapi): - if eapi in ("4-python",): + """ + When eapi is None then validation is not as strict, since we want the + same to work for multiple EAPIs that may have slightly different rules. + @param eapi: The EAPI + @type eapi: String or None + @rtype: regular expression object + @return: A regular expression object that matches valid USE flags for t= he + given eapi. + """ + if eapi in (None, "4-python",): return _useflag_re["4-python"] else: return _useflag_re["0"] diff --git a/pym/portage/tests/dep/test_use_reduce.py b/pym/portage/tests= /dep/test_use_reduce.py index ac81563..1618430 100644 --- a/pym/portage/tests/dep/test_use_reduce.py +++ b/pym/portage/tests/dep/test_use_reduce.py @@ -8,7 +8,7 @@ from portage.dep import Atom, use_reduce class UseReduceTestCase(object): def __init__(self, deparray, uselist=3D[], masklist=3D[], \ matchall=3D0, excludeall=3D[], is_src_uri=3DFalse, \ - eapi=3DNone, opconvert=3DFalse, flat=3DFalse, expected_result=3DNone, = \ + eapi=3D"0", opconvert=3DFalse, flat=3DFalse, expected_result=3DNone, \ is_valid_flag=3DNone, token_class=3DNone): self.deparray =3D deparray self.uselist =3D uselist