public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/
@ 2012-09-22 21:52 Zac Medico
  0 siblings, 0 replies; 5+ messages in thread
From: Zac Medico @ 2012-09-22 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     12ff9e4d8006664c3d154651aeb8403c2c7aaa8a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 22 21:52:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 22 21:52:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12ff9e4d

Use re.UNICODE for category/package name regexes.

This only affects r'\w' with Python 2.x, since Python 3 already
defaults to re.UNICODE behavior when compiling unicode str objects
(unless re.ASCII is specified). If a repository wants to ban unicode
categore/package names then we can add a layout.conf setting for that,
as discussed in bug #435934.

---
 pym/portage/dep/__init__.py |   10 +++++-----
 pym/portage/manifest.py     |   16 +++++++++++++++-
 pym/portage/versions.py     |    4 ++--
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index b4b240d..6e03004 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -72,7 +72,7 @@ def _get_slot_re(eapi_attrs):
 	else:
 		slot_re = _slot
 
-	slot_re = re.compile('^' + slot_re + '$', re.VERBOSE)
+	slot_re = re.compile('^' + slot_re + '$', re.VERBOSE | re.UNICODE)
 
 	_slot_re_cache[cache_key] = slot_re
 	return slot_re
@@ -90,7 +90,7 @@ def _get_slot_dep_re(eapi_attrs):
 	else:
 		slot_re = _slot
 
-	slot_re = re.compile('^' + slot_re + '$', re.VERBOSE)
+	slot_re = re.compile('^' + slot_re + '$', re.VERBOSE | re.UNICODE)
 
 	_slot_dep_re_cache[cache_key] = slot_re
 	return slot_re
@@ -123,7 +123,7 @@ def _get_atom_re(eapi_attrs):
 		'(?P<star>=' + cpv_re + r'\*)|' +
 		'(?P<simple>' + cp_re + '))' + 
 		'(' + _slot_separator + _slot_loose + ')?' +
-		_repo + ')(' + _use + ')?$', re.VERBOSE)
+		_repo + ')(' + _use + ')?$', re.VERBOSE | re.UNICODE)
 
 	_atom_re_cache[cache_key] = atom_re
 	return atom_re
@@ -145,7 +145,7 @@ def _get_atom_wildcard_re(eapi_attrs):
 		_extended_cat + r')/(' + pkg_re + r'))' + \
 		'|(?P<star>=((' + _extended_cat + r')/(' + pkg_re + r'))-(?P<version>\*\d+\*)))' + \
 		'(:(?P<slot>' + _slot_loose + r'))?(' +
-		_repo_separator + r'(?P<repo>' + _repo_name + r'))?$')
+		_repo_separator + r'(?P<repo>' + _repo_name + r'))?$', re.UNICODE)
 
 	_atom_wildcard_re_cache[cache_key] = atom_re
 	return atom_re
@@ -1585,7 +1585,7 @@ def extended_cp_match(extended_cp, other_cp):
 	extended_cp_re = _extended_cp_re_cache.get(extended_cp)
 	if extended_cp_re is None:
 		extended_cp_re = re.compile("^" + re.escape(extended_cp).replace(
-			r'\*', '[^/]*') + "$")
+			r'\*', '[^/]*') + "$", re.UNICODE)
 		_extended_cp_re_cache[extended_cp] = extended_cp_re
 	return extended_cp_re.match(other_cp) is not None
 

diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py
index b2f1ff2..25886bb 100644
--- a/pym/portage/manifest.py
+++ b/pym/portage/manifest.py
@@ -4,6 +4,7 @@
 import errno
 import io
 import re
+import sys
 import warnings
 
 import portage
@@ -24,6 +25,11 @@ from portage.const import (MANIFEST1_HASH_FUNCTIONS, MANIFEST2_HASH_DEFAULTS,
 	MANIFEST2_HASH_FUNCTIONS, MANIFEST2_IDENTIFIERS, MANIFEST2_REQUIRED_HASH)
 from portage.localization import _
 
+if sys.hexversion >= 0x3000000:
+	_unicode = str
+else:
+	_unicode = unicode
+
 # Characters prohibited by repoman's file.name check.
 _prohibited_filename_chars_re = re.compile(r'[^a-zA-Z0-9._\-+:]')
 
@@ -108,6 +114,14 @@ class Manifest2Entry(ManifestEntry):
 	def __ne__(self, other):
 		return not self.__eq__(other)
 
+	if sys.hexversion < 0x3000000:
+
+		__unicode__ = __str__
+
+		def __str__(self):
+			return _unicode_encode(self.__unicode__(),
+				encoding=_encodings['repo.content'], errors='strict')
+
 class Manifest(object):
 	parsers = (parseManifest2,)
 	def __init__(self, pkgdir, distdir, fetchlist_dict=None,
@@ -289,7 +303,7 @@ class Manifest(object):
 					# thin manifests with no DIST entries, myentries is
 					# non-empty for all currently known use cases.
 					write_atomic(self.getFullname(), "".join("%s\n" %
-						str(myentry) for myentry in myentries))
+						_unicode(myentry) for myentry in myentries))
 				else:
 					# With thin manifest, there's no need to have
 					# a Manifest file if there are no DIST entries.

diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index 242623f..a9b7e64 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -79,7 +79,7 @@ def _get_pv_re(eapi_attrs):
 	else:
 		pv_re = _pv['dots_disallowed_in_PN']
 
-	pv_re = re.compile('^' + pv_re + '$', re.VERBOSE)
+	pv_re = re.compile(_unicode_decode('^' + pv_re + '$'), re.VERBOSE | re.UNICODE)
 
 	_pv_re_cache[cache_key] = pv_re
 	return pv_re
@@ -292,7 +292,7 @@ def _pkgsplit(mypkg, eapi=None):
 
 	return  (m.group('pn'), m.group('ver'), rev) 
 
-_cat_re = re.compile('^%s$' % _cat)
+_cat_re = re.compile('^%s$' % _cat, re.UNICODE)
 _missing_cat = 'null'
 
 def catpkgsplit(mydata, silent=1, eapi=None):


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/
@ 2012-06-10 23:16 Zac Medico
  0 siblings, 0 replies; 5+ messages in thread
From: Zac Medico @ 2012-06-10 23:16 UTC (permalink / raw
  To: gentoo-commits

commit:     daa04443e97f62555efd4a2a301103a27b7579b7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 10 23:16:25 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 10 23:16:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=daa04443

use_reduce: use _eapi_attrs

---
 pym/portage/dep/__init__.py |    5 +++--
 pym/portage/eapi.py         |    3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 6c2a3ad..4d0c4e2 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -37,7 +37,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 )
 
 from portage import _unicode_decode
-from portage.eapi import eapi_has_src_uri_arrows, _get_eapi_attrs
+from portage.eapi import _get_eapi_attrs
 from portage.exception import InvalidAtom, InvalidData, InvalidDependString
 from portage.localization import _
 from portage.versions import catpkgsplit, catsplit, \
@@ -438,6 +438,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
 	if matchall and matchnone:
 		raise ValueError("portage.dep.use_reduce: 'matchall' and 'matchnone' are mutually exclusive")
 
+	eapi_attrs = _get_eapi_attrs(eapi)
 	useflag_re = _get_useflag_re(eapi)
 
 	def is_active(conditional):
@@ -653,7 +654,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
 			if not is_src_uri:
 				raise InvalidDependString(
 					_("SRC_URI arrow are only allowed in SRC_URI: token %s") % (pos+1,))
-			if eapi is None or not eapi_has_src_uri_arrows(eapi):
+			if not eapi_attrs.src_uri_arrows:
 				raise InvalidDependString(
 					_("SRC_URI arrow not allowed in EAPI %s: token %s") % (eapi, pos+1))
 			need_simple_token = True

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 4dd02db..ca8af9c 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -65,7 +65,7 @@ def eapi_allows_dots_in_use_flags(eapi):
 
 _eapi_attrs = collections.namedtuple('_eapi_attrs',
 	'dots_in_PN dots_in_use_flags repo_deps slot_deps '
-	'strong_blocks use_deps use_dep_defaults')
+	'src_uri_arrows strong_blocks use_deps use_dep_defaults')
 
 _eapi_attrs_cache = {}
 
@@ -83,6 +83,7 @@ def _get_eapi_attrs(eapi):
 		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
 		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
 		slot_deps = (eapi is None or eapi_has_slot_deps(eapi)),
+		src_uri_arrows = (eapi is None or eapi_has_src_uri_arrows(eapi)),
 		strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)),
 		use_deps = (eapi is None or eapi_has_use_deps(eapi)),
 		use_dep_defaults = (eapi is None or eapi_has_use_dep_defaults(eapi))



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/
@ 2012-06-10 23:05 Zac Medico
  0 siblings, 0 replies; 5+ messages in thread
From: Zac Medico @ 2012-06-10 23:05 UTC (permalink / raw
  To: gentoo-commits

commit:     07fbd0a29455f2e74c66b37f30c62a7ddb0c5571
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 10 23:05:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 10 23:05:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=07fbd0a2

_get_eapi_attrs: move to eapi module

---
 pym/portage/dep/__init__.py |   33 +--------------------------------
 pym/portage/eapi.py         |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 32 deletions(-)

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index d985486..6c2a3ad 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -27,7 +27,6 @@ __all__ = [
 # "a? ( b? ( z ) ) -- Valid
 #
 
-import collections
 import re, sys
 import warnings
 from itertools import chain
@@ -38,9 +37,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 )
 
 from portage import _unicode_decode
-from portage.eapi import eapi_has_slot_deps, eapi_has_src_uri_arrows, \
-	eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults, \
-	eapi_has_repo_deps, eapi_allows_dots_in_PN, eapi_allows_dots_in_use_flags
+from portage.eapi import eapi_has_src_uri_arrows, _get_eapi_attrs
 from portage.exception import InvalidAtom, InvalidData, InvalidDependString
 from portage.localization import _
 from portage.versions import catpkgsplit, catsplit, \
@@ -72,34 +69,6 @@ _repo = r'(?:' + _repo_separator + '(' + _repo_name + ')' + ')?'
 
 _extended_cat = r'[\w+*][\w+.*-]*'
 
-_eapi_attrs = collections.namedtuple('_eapi_attrs',
-	'dots_in_PN dots_in_use_flags repo_deps slot_deps '
-	'strong_blocks use_deps use_dep_defaults')
-
-_eapi_attrs_cache = {}
-
-def _get_eapi_attrs(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.
-	"""
-	eapi_attrs = _eapi_attrs_cache.get(eapi)
-	if eapi_attrs is not None:
-		return eapi_attrs
-
-	eapi_attrs = _eapi_attrs(
-		dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
-		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
-		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
-		slot_deps = (eapi is None or eapi_has_slot_deps(eapi)),
-		strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)),
-		use_deps = (eapi is None or eapi_has_use_deps(eapi)),
-		use_dep_defaults = (eapi is None or eapi_has_use_dep_defaults(eapi))
-	)
-
-	_eapi_attrs_cache[eapi] = eapi_attrs
-	return eapi_attrs
-
 _atom_re_cache = {}
 
 def _get_atom_re(eapi_attrs):

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 79cf891..4dd02db 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -1,6 +1,8 @@
 # Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import collections
+
 def eapi_has_iuse_defaults(eapi):
 	return eapi != "0"
 
@@ -60,3 +62,31 @@ def eapi_allows_dots_in_PN(eapi):
 
 def eapi_allows_dots_in_use_flags(eapi):
 	return eapi in ("4-python",)
+
+_eapi_attrs = collections.namedtuple('_eapi_attrs',
+	'dots_in_PN dots_in_use_flags repo_deps slot_deps '
+	'strong_blocks use_deps use_dep_defaults')
+
+_eapi_attrs_cache = {}
+
+def _get_eapi_attrs(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.
+	"""
+	eapi_attrs = _eapi_attrs_cache.get(eapi)
+	if eapi_attrs is not None:
+		return eapi_attrs
+
+	eapi_attrs = _eapi_attrs(
+		dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
+		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
+		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
+		slot_deps = (eapi is None or eapi_has_slot_deps(eapi)),
+		strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)),
+		use_deps = (eapi is None or eapi_has_use_deps(eapi)),
+		use_dep_defaults = (eapi is None or eapi_has_use_dep_defaults(eapi))
+	)
+
+	_eapi_attrs_cache[eapi] = eapi_attrs
+	return eapi_attrs



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/
@ 2012-05-12  4:08 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 5+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-05-12  4:08 UTC (permalink / raw
  To: gentoo-commits

commit:     0098ee7395e2c9b35471a5c088eef1fa59946912
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat May 12 04:07:12 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sat May 12 04:07:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0098ee73

Add portage.eapi.eapi_allows_dots_in_use_flags().

---
 pym/portage/dep/__init__.py |   22 +++++++++++-----------
 pym/portage/eapi.py         |    3 +++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 6770140..2e3444d 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -39,7 +39,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 from portage import _unicode_decode
 from portage.eapi import eapi_has_slot_deps, eapi_has_src_uri_arrows, \
 	eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults, \
-	eapi_has_repo_deps, eapi_allows_dots_in_PN
+	eapi_has_repo_deps, eapi_allows_dots_in_PN, eapi_allows_dots_in_use_flags
 from portage.exception import InvalidAtom, InvalidData, InvalidDependString
 from portage.localization import _
 from portage.versions import catpkgsplit, catsplit, \
@@ -642,8 +642,8 @@ def flatten(mylist):
 
 
 _usedep_re = {
-	"0":        re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
-	"4-python": re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@.-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
+	"dots_disallowed_in_use_flags": re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
+	"dots_allowed_in_use_flags":    re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@.-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
 }
 
 def _get_usedep_re(eapi):
@@ -656,10 +656,10 @@ def _get_usedep_re(eapi):
 	@return: A regular expression object that matches valid USE deps for the
 		given eapi.
 	"""
-	if eapi in (None, "4-python",):
-		return _usedep_re["4-python"]
+	if eapi is None or eapi_allows_dots_in_use_flags(eapi):
+		return _usedep_re["dots_allowed_in_use_flags"]
 	else:
-		return _usedep_re["0"]
+		return _usedep_re["dots_disallowed_in_use_flags"]
 
 class _use_dep(object):
 
@@ -1677,8 +1677,8 @@ def _get_atom_wildcard_re(eapi):
 		return _atom_wildcard_re["dots_disallowed_in_PN"]
 
 _useflag_re = {
-	"0":        re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@-]*$'),
-	"4-python": re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@.-]*$'),
+	"dots_disallowed_in_use_flags": re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@-]*$'),
+	"dots_allowed_in_use_flags":    re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@.-]*$'),
 }
 
 def _get_useflag_re(eapi):
@@ -1691,10 +1691,10 @@ def _get_useflag_re(eapi):
 	@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"]
+	if eapi is None or eapi_allows_dots_in_use_flags(eapi):
+		return _useflag_re["dots_allowed_in_use_flags"]
 	else:
-		return _useflag_re["0"]
+		return _useflag_re["dots_disallowed_in_use_flags"]
 
 def isvalidatom(atom, allow_blockers=False, allow_wildcard=False, allow_repo=False):
 	"""

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index f09052d..79cf891 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -57,3 +57,6 @@ def eapi_has_repo_deps(eapi):
 
 def eapi_allows_dots_in_PN(eapi):
 	return eapi in ("4-python",)
+
+def eapi_allows_dots_in_use_flags(eapi):
+	return eapi in ("4-python",)



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/
@ 2011-06-08 16:10 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 5+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-06-08 16:10 UTC (permalink / raw
  To: gentoo-commits

commit:     586760f37fb9784327d8447182d49810662f4427
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Jun  8 16:10:23 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Wed Jun  8 16:10:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=586760f3

Add initial support for EAPI="4-python".

---
 pym/portage/__init__.py     |    2 +-
 pym/portage/dep/__init__.py |   22 ++++++++++------------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 515a9a7..bc2eedb 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -421,7 +421,7 @@ def abssymlink(symlink):
 
 _doebuild_manifest_exempt_depend = 0
 
-_testing_eapis = frozenset([])
+_testing_eapis = frozenset(["4-python"])
 _deprecated_eapis = frozenset(["4_pre1", "3_pre2", "3_pre1"])
 
 def _eapi_is_deprecated(eapi):

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 5911c8c..9dfb125 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -633,7 +633,7 @@ def flatten(mylist):
 
 _usedep_re = {
 	"0": re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
-#	"5": re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@.-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
+	"4-python": re.compile("^(?P<prefix>[!-]?)(?P<flag>[A-Za-z0-9][A-Za-z0-9+_@.-]*)(?P<default>(\(\+\)|\(\-\))?)(?P<suffix>[?=]?)$"),
 }
 
 def _get_usedep_re(eapi):
@@ -644,11 +644,10 @@ def _get_usedep_re(eapi):
 	@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 _usedep_re["0"]
-#	if eapi in ("0", "1", "2", "3_pre1", "3_pre2", "3", "4_pre1", "4"):
-#		return _usedep_re["0"]
-#	else:
-#		return _usedep_re["5"]
+	if eapi in ("4-python",):
+		return _usedep_re["4-python"]
+	else:
+		return _usedep_re["0"]
 
 class _use_dep(object):
 
@@ -1615,15 +1614,14 @@ _atom_wildcard_re = re.compile('(?P<simple>(' + _extended_cat + ')/(' + _extende
 
 _useflag_re = {
 	"0": re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@-]*$'),
-#	"5": re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@.-]*$'),
+	"4-python": re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@.-]*$'),
 }
 
 def _get_useflag_re(eapi):
-	return _useflag_re["0"]
-#	if eapi in ("0", "1", "2", "3_pre1", "3_pre2", "3", "4_pre1", "4"):
-#		return _useflag_re["0"]
-#	else:
-#		return _useflag_re["5"]
+	if eapi in ("4-python",):
+		return _useflag_re["4-python"]
+	else:
+		return _useflag_re["0"]
 
 def isvalidatom(atom, allow_blockers=False, allow_wildcard=False, allow_repo=False):
 	"""



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-22 21:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22 21:52 [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2012-06-10 23:16 Zac Medico
2012-06-10 23:05 Zac Medico
2012-05-12  4:08 Arfrever Frehtes Taifersar Arahesis
2011-06-08 16:10 Arfrever Frehtes Taifersar Arahesis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox