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 / +16 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+-]+(              # String with a hyphen...
850
		[A-Za-z+_-]+       # ... must end in nondigit
851
		|[A-Za-z+_]+[\w+]+ # ... or have nondigit and then nonhyphen
852
	)
853
))'''
846
854
847
# 2.1.3 A slot name may contain any of the characters [A-Za-z0-9+_.-].
855
# 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.
856
# It must not begin with a hyphen or a dot.
849
_slot = r'(:[A-Za-z0-9+_][A-Za-z0-9+_.-]*)?'
857
_slot = r'(:[\w+][\w+.-]*)?'
850
858
851
_use = r'(\[.*\])?'
859
_use = r'(\[.*\])?'
852
_op = r'([=><~]|([><]=))'
860
_op = r'([=~]|[><]=?)'
853
_cp = _cat + '/' + _pkg
861
_cp = _cat + '/' + _pkg
854
_cpv = _cp + '-' + _version
862
_cpv = _cp + '-' + _version
855
863
856
_cpv_re = re.compile('^' + _cpv + '$')
864
_cpv_re = re.compile('^' + _cpv + '$', re.VERBOSE)
857
_atom_re = re.compile(r'^(' +
865
_atom_re = re.compile(r'^(' +
858
	'(' + _op + _cpv + _slot + _use + ')|' +
866
	'(' + _op + _cpv + _slot + _use + ')|' +
859
	'(=' + _cpv + r'\*' + _slot + _use + ')|' +
867
	'(=' + _cpv + r'\*' + _slot + _use + ')|' +
860
	'(' + _cp + _slot + _use + ')' +
868
	'(' + _cp + _slot + _use + ')' +
861
	')$')
869
	')$', re.VERBOSE)
862
870
863
def isvalidatom(atom, allow_blockers=False):
871
def isvalidatom(atom, allow_blockers=False):
864
	"""
872
	"""
(-)a/pym/portage/tests/dep/test_isvalidatom.py (+3 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 ),
83
			  ( "=dev-libs/poppler-qt3-0.11*", True ),
81
		]
84
		]
82
85
83
		for test in tests:
86
		for test in tests:

Return to bug 276813