diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-06-09 11:48:19 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-06-09 11:48:19 -0700 |
commit | d85506e8a37778e0935f43f9e7cc62bb8b933063 (patch) | |
tree | a7dc47880cac73c993a5766fdc60f50b15c71319 /pym/portage/dep | |
parent | SubProcess: fix status for _set_returncode caller (diff) | |
download | portage-d85506e8a37778e0935f43f9e7cc62bb8b933063.tar.gz portage-d85506e8a37778e0935f43f9e7cc62bb8b933063.tar.bz2 portage-d85506e8a37778e0935f43f9e7cc62bb8b933063.zip |
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.
Diffstat (limited to 'pym/portage/dep')
-rw-r--r-- | pym/portage/dep/__init__.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index ba373241f..b9020a7a7 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"] |