--- src/java_config_2/VersionManager.py.old 2013-02-15 02:12:09.000000000 +0400 +++ src/java_config_2/VersionManager.py 2015-04-27 15:36:02.467389500 +0300 @@ -51,7 +51,7 @@ """ Used to parse dependency strings, and find the best/prefered vm to use. """ - atom_parser = re.compile(r"([<>=]*)virtual/(jre|jdk)[-:]([0-9\.*]+)") + atom_parser = re.compile(r"([<>=]*)virtual/(jre|jdk)(-([0-9\.*]+))?(:([0-9\.]+=?|=|\*))?") virtuals_parser = re.compile(r"([<>=~]+)?java-virtuals/([\w\-\.:]+)") package_parser = re.compile(r"([\w\-]+)/([\w\-]+)(?:\:(\d+))?") @@ -88,7 +88,17 @@ if len(matches) > 0: for match in matches: - matched_atoms.append(_DepSpec(equality=match[0], type=match[1], version=match[2])) + equality=match[0] + if match[3]: # if version is nonempty use it + ver = match[3] + elif match[5] and match[5] != "=" and match[5] != '*': # fallback to probe the slot value + ver = match[5] + if ver[-1] == '=': + ver = ver[:-1] + else: + equality='*' # match case without version in a special way + ver='0' + matched_atoms.append(_DepSpec(equality=equality, type=match[1], version=ver)) matched_atoms.sort() matched_atoms.reverse() @@ -149,7 +159,8 @@ #now assuming that if no operator we are #doing an '=' comparision. Used to handle cases like virtual/jdk:1.5 - if operator == '>=': return val >= 0 + if operator == '*': return True + elif operator == '>=': return val >= 0 elif operator == '<=': return val <= 0 elif operator == '>': return val > 0 elif operator == '<': return val < 0