Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 203509 Details for
Bug 276813
sys-apps/portage Performance improvement
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Simplifies isvalidatom regex and adds comments
verbose_regex.patch (text/plain), 2.18 KB, created by
Marat Radchenko
on 2009-09-08 16:32:03 UTC
(
hide
)
Description:
Simplifies isvalidatom regex and adds comments
Filename:
MIME Type:
Creator:
Marat Radchenko
Created:
2009-09-08 16:32:03 UTC
Size:
2.18 KB
patch
obsolete
>diff --git a/pym/portage/dep.py b/pym/portage/dep.py >index 8c3317e..05e06df 100644 >--- a/pym/portage/dep.py >+++ b/pym/portage/dep.py >@@ -833,32 +833,38 @@ def dep_getusedeps( depend ): > open_bracket = depend.find( '[', open_bracket+1 ) > return tuple(use_list) > >+# \w is [a-zA-Z0-9_] >+ > # 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-]. > # It must not begin with a hyphen or a dot. >-_cat = r'[A-Za-z0-9+_][A-Za-z0-9+_.-]*' >+_cat = r'[\w+][\w+.-]*' > > # 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-]. > # It must not begin with a hyphen, > # and must not end in a hyphen followed by one or more digits. >-_pkg = r'([A-Za-z+_]+[A-Za-z0-9+_]+|([A-Za-z0-9+_](' + \ >- '[A-Za-z0-9+_-]?|' + \ >- '([A-Za-z0-9+_-]*(([A-Za-z0-9+_][A-Za-z+_-]+)|([A-Za-z+_][A-Za-z0-9+_]+))))))' >+_pkg = \ >+r'''([\w+]( >+ -? # All other 2-char are handled by next >+ |[\w+]* # No hyphens - no problems >+ |[\w+-]*[\w+][A-Za-z+_-]+ # String with hyphen must be followed by >+ # non-hyphen and then non-digit >+))''' > > # 2.1.3 A slot name may contain any of the characters [A-Za-z0-9+_.-]. > # It must not begin with a hyphen or a dot. >-_slot = r'(:[A-Za-z0-9+_][A-Za-z0-9+_.-]*)?' >+_slot = r'(:[\w+][\w+.-]*)?' > > _use = r'(\[.*\])?' >-_op = r'([=><~]|([><]=))' >+_op = r'([=~]|[><]=?)' > _cp = _cat + '/' + _pkg > _cpv = _cp + '-' + _version > >-_cpv_re = re.compile('^' + _cpv + '$') >+_cpv_re = re.compile('^' + _cpv + '$', re.VERBOSE) > _atom_re = re.compile(r'^(' + > '(' + _op + _cpv + _slot + _use + ')|' + > '(=' + _cpv + r'\*' + _slot + _use + ')|' + > '(' + _cp + _slot + _use + ')' + >- ')$') >+ ')$', re.VERBOSE) > > def isvalidatom(atom, allow_blockers=False): > """ >diff --git a/pym/portage/tests/dep/test_isvalidatom.py b/pym/portage/tests/dep/test_isvalidatom.py >index 7797025..d109e0d 100644 >--- a/pym/portage/tests/dep/test_isvalidatom.py >+++ b/pym/portage/tests/dep/test_isvalidatom.py >@@ -78,6 +78,8 @@ class IsValidAtom(TestCase): > ( "~games-strategy/ufo2000-0.1", True ), > ( "=media-libs/x264-20060810", True ), > ( "foo/b", True ), >+ ( "app-text/7plus", True ), >+ ( "foo/666", True ), > ] > > for test in tests:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 276813
:
196987
|
197434
|
197437
|
197827
|
198253
|
203267
|
203269
|
203406
|
203509
|
203512
|
203515
|
203519
|
204572
|
204597
|
204673
|
204685
|
204770
|
204883
|
204996
|
205039