Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 276813 | Differences between
and this patch

Collapse All | Expand All

(-)a/pym/portage/dep.py (-8 / +14 lines)
Lines 833-864 def dep_getusedeps( depend ): Link Here
833
		open_bracket = depend.find( '[', open_bracket+1 )
833
		open_bracket = depend.find( '[', open_bracket+1 )
834
	return tuple(use_list)
834
	return tuple(use_list)
835
835
836
# \w is [a-zA-Z0-9_]
837
836
# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-].
838
# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-].
837
# It must not begin with a hyphen or a dot.
839
# It must not begin with a hyphen or a dot.
838
_cat = r'[A-Za-z0-9+_][A-Za-z0-9+_.-]*'
840
_cat = r'[\w+][\w+.-]*'
839
841
840
# 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-].
842
# 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-].
841
# It must not begin with a hyphen,
843
# It must not begin with a hyphen,
842
# and must not end in a hyphen followed by one or more digits.
844
# and must not end in a hyphen followed by one or more digits.
843
_pkg = r'([A-Za-z+_]+[A-Za-z0-9+_]+|([A-Za-z0-9+_](' + \
845
_pkg = \
844
	'[A-Za-z0-9+_-]?|' + \
846
r'''([\w+](
845
	'([A-Za-z0-9+_-]*(([A-Za-z0-9+_][A-Za-z+_-]+)|([A-Za-z+_][A-Za-z0-9+_]+))))))'
847
	-?                        # All other 2-char are handled by next
848
	|[\w+]*                   # No hyphens - no problems
849
	|[\w+-]*[\w+][A-Za-z+_-]+ # String with hyphen must be followed by
850
	                          # non-hyphen and then non-digit
851
))'''
846
852
847
# 2.1.3 A slot name may contain any of the characters [A-Za-z0-9+_.-].
853
# 2.1.3 A slot name may contain any of the characters [A-Za-z0-9+_.-].
848
# It must not begin with a hyphen or a dot.
854
# It must not begin with a hyphen or a dot.
849
_slot = r'(:[A-Za-z0-9+_][A-Za-z0-9+_.-]*)?'
855
_slot = r'(:[\w+][\w+.-]*)?'
850
856
851
_use = r'(\[.*\])?'
857
_use = r'(\[.*\])?'
852
_op = r'([=><~]|([><]=))'
858
_op = r'([=~]|[><]=?)'
853
_cp = _cat + '/' + _pkg
859
_cp = _cat + '/' + _pkg
854
_cpv = _cp + '-' + _version
860
_cpv = _cp + '-' + _version
855
861
856
_cpv_re = re.compile('^' + _cpv + '$')
862
_cpv_re = re.compile('^' + _cpv + '$', re.VERBOSE)
857
_atom_re = re.compile(r'^(' +
863
_atom_re = re.compile(r'^(' +
858
	'(' + _op + _cpv + _slot + _use + ')|' +
864
	'(' + _op + _cpv + _slot + _use + ')|' +
859
	'(=' + _cpv + r'\*' + _slot + _use + ')|' +
865
	'(=' + _cpv + r'\*' + _slot + _use + ')|' +
860
	'(' + _cp + _slot + _use + ')' +
866
	'(' + _cp + _slot + _use + ')' +
861
	')$')
867
	')$', re.VERBOSE)
862
868
863
def isvalidatom(atom, allow_blockers=False):
869
def isvalidatom(atom, allow_blockers=False):
864
	"""
870
	"""
(-)a/pym/portage/tests/dep/test_isvalidatom.py (+2 lines)
Lines 78-83 class IsValidAtom(TestCase): Link Here
78
			  ( "~games-strategy/ufo2000-0.1", True ),
78
			  ( "~games-strategy/ufo2000-0.1", True ),
79
			  ( "=media-libs/x264-20060810", True ),
79
			  ( "=media-libs/x264-20060810", True ),
80
			  ( "foo/b", True ),
80
			  ( "foo/b", True ),
81
			  ( "app-text/7plus", True ),
82
			  ( "foo/666", True ),
81
		]
83
		]
82
84
83
		for test in tests:
85
		for test in tests:

Return to bug 276813