Index: src/java_config_2/VersionManager.py =================================================================== --- src/java_config_2/VersionManager.py (revision 8224) +++ src/java_config_2/VersionManager.py (working copy) @@ -1,4 +1,4 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- # Copyright 2005 Gentoo Foundation # Distributed under the terms of the GNU General Public license v2 @@ -53,7 +53,13 @@ """ atom_parser = re.compile(r"([<>=]*)virtual/(jre|jdk)[-:]([0-9\.*]+)") virtuals_parser = re.compile(r"([<>=~]+)?java-virtuals/([\w\-\.:]+)") - package_parser = re.compile(r"([\w\-]+)/([\w\-]+)(?:\:(\d+))?") + package_parser = re.compile(r""" + (!?!?(?:<|<=|=|~|>=|>)?) + ([A-Za-z0-9+_][A-Za-z0-9+_.\-]*)/ + ([A-Za-z0-9+_](?:[A-Za-z0-9+_\-]*(?:[A-Za-z+_][0-9]+|[A-Za-z+_])|[0-9])?) + (-[0-9]+(?:\.[0-9]+)*[a-z]?(?:_(?:alpha|beta|pre|rc|p)[0-9]*)?(?:-r[0-9]+)?)? + (:[A-Za-z0-9+_.][A-Za-z0-9+_.\-]*)? + """, re.X) user_pref_file = '/etc/java-config-2/build/jdk.conf' default_pref_file = '/usr/share/java-config-2/config/jdk-defaults.conf' _prefs = None @@ -107,8 +113,13 @@ if len(matches) > 0: for match in matches: - if not (match[0] == 'virtual' and (match[1] == 'jdk-1' or match[1] == 'jre-1' or match[1] == 'jdk' or match[1] == 'jre' )): - matched_atoms.append({'equality':'=', 'cat':match[0], 'pkg':match[1], 'slot':match[2]}) + if (not match[0].startswith('!') and + not (match[1] == 'virtual' and + (match[2] in ['jdk-1', 'jre-1', 'jdk', 'jre']))): + matched_atoms.append({'equality':'=', + 'cat':match[1], + 'pkg':match[2], + 'slot':match[4][1:]}) return matched_atoms