diff options
author | 2013-07-16 00:30:17 +0200 | |
---|---|---|
committer | 2013-07-16 00:30:17 +0200 | |
commit | 21890525bfd7419ad60a0b370cb14de468da2f36 (patch) | |
tree | ce24cd084a44bf3accaf31954de53139d0a98056 | |
parent | roverlay/depres/listeners: sort unresolvable (diff) | |
download | R_overlay-21890525bfd7419ad60a0b370cb14de468da2f36.tar.gz R_overlay-21890525bfd7419ad60a0b370cb14de468da2f36.tar.bz2 R_overlay-21890525bfd7419ad60a0b370cb14de468da2f36.zip |
roverlay/depres/depenv, fuzzy: ignore certain words
-rw-r--r-- | roverlay/depres/depenv.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/roverlay/depres/depenv.py b/roverlay/depres/depenv.py index 7455360..c8fea7e 100644 --- a/roverlay/depres/depenv.py +++ b/roverlay/depres/depenv.py @@ -54,7 +54,7 @@ class DepEnv ( object ): # excluding A-Z since dep_str_low will be used to find a match # _NAME ::= word{<whitespace><word>} - _NAME = '(?P<name>[a-z0-9_\-/.+-]+(\s+[a-z0-9_\-/.+-]+)*)' + _NAME = '(?P<name>[a-z0-9_\-/.:+-]+(\s+[a-z0-9_\-/.+-]+)*)' # _VER ::= [[<version_separator>]*<digit>[<digit>]*]* # digit ::= {0..9} @@ -65,6 +65,9 @@ class DepEnv ( object ): # { <, >, ==, <=, >=, =, != } _VERMOD = '(?P<vmod>[<>]|[=<>!]?[=])' + _NAME_PREFIX = '(?P<name_prefix>for building from source[:])' + _NAME_SUFFIX = '(?P<name_suffix>lib|library)' + # integer representation of version modifiers ## duplicate of versiontuple.py VMOD_NONE = roverlay.versiontuple.VMOD_NONE @@ -91,22 +94,26 @@ class DepEnv ( object ): VERSION_REGEX = frozenset ( re.compile ( r ) for r in (( # 'R >= 2.15', 'R >=2.15' etc. (but not 'R>=2.15'!) - '^{name}\s+{vermod}?\s*{ver}\s*$'.format ( - name=_NAME, vermod=_VERMOD, ver=_VER + '^{prefix}?\s*{name}\s+{vermod}?\s*{ver}\s*{suffix}?\s*$'.format ( + name=_NAME, vermod=_VERMOD, ver=_VER, + prefix=_NAME_PREFIX, suffix=_NAME_SUFFIX, ), # 'R (>= 2.15)', 'R(>=2.15)' etc. - '^{name}\s*\(\s*{vermod}?\s*{ver}\s*\)$'.format ( - name=_NAME, vermod=_VERMOD, ver=_VER + '^{prefix}?\s*{name}\s*\(\s*{vermod}?\s*{ver}\s*\)\s*{suffix}?$'.format ( + name=_NAME, vermod=_VERMOD, ver=_VER, + prefix=_NAME_PREFIX, suffix=_NAME_SUFFIX, ), # 'R [>= 2.15]', 'R[>=2.15]' etc. - '^{name}\s*\[\s*{vermod}?\s*{ver}\s*\]$'.format ( - name=_NAME, vermod=_VERMOD, ver=_VER + '^{prefix}?\s*{name}\s*\[\s*{vermod}?\s*{ver}\s*\]\s*{suffix}?$'.format ( + name=_NAME, vermod=_VERMOD, ver=_VER, + prefix=_NAME_PREFIX, suffix=_NAME_SUFFIX, ), # 'R {>= 2.15}', 'R{>=2.15}' etc. - '^{name}\s*\{{\s*{vermod}?\s*{ver}\s*\}}$'.format ( - name=_NAME, vermod=_VERMOD, ver=_VER + '^{prefix}?\s*{name}\s*\{{\s*{vermod}?\s*{ver}\s*\}}\s*{suffix}?$'.format ( + name=_NAME, vermod=_VERMOD, ver=_VER, + prefix=_NAME_PREFIX, suffix=_NAME_SUFFIX, ), )) ) @@ -207,7 +214,6 @@ class DepEnv ( object ): version_iparts.append ( int ( v2 ) if v2 else 0 ) - result.append ( dict ( name = m.group ( 'name' ), name_low = m.group ( 'name' ).lower(), |