public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/portage/tests/dep/
Date: Thu,  9 Jun 2011 18:48:48 +0000 (UTC)	[thread overview]
Message-ID: <d85506e8a37778e0935f43f9e7cc62bb8b933063.zmedico@gentoo> (raw)

commit:     d85506e8a37778e0935f43f9e7cc62bb8b933063
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 18:48:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 18:48:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d85506e8

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 = {
 
 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 the
-		given eapi. If eapi is None then the latest supported EAPI is assumed.
+	@return: A regular expression object that matches valid USE deps for the
+		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 = {
 }
 
 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 the
+		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=[], masklist=[], \
 		matchall=0, excludeall=[], is_src_uri=False, \
-		eapi=None, opconvert=False, flat=False, expected_result=None, \
+		eapi="0", opconvert=False, flat=False, expected_result=None, \
 			is_valid_flag=None, token_class=None):
 		self.deparray = deparray
 		self.uselist = uselist



             reply	other threads:[~2011-06-09 18:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 18:48 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-21 20:15 [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/portage/tests/dep/ Zac Medico
2013-06-09  0:23 Zac Medico
2013-05-24 18:02 Zac Medico
2013-01-04  4:35 Zac Medico
2012-09-18 20:17 Zac Medico
2012-07-18 21:07 Zac Medico
2012-05-13 20:11 Zac Medico
2011-10-04  4:45 Zac Medico
2011-06-09 14:24 Zac Medico
2011-02-07 22:00 Zac Medico
2011-02-05  0:16 Zac Medico
2011-02-04 22:32 Zac Medico
2011-02-04 21:07 zmedico
2011-02-04  5:42 zmedico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d85506e8a37778e0935f43f9e7cc62bb8b933063.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox