diff options
author | Marius Mauch <genone@gentoo.org> | 2008-09-25 17:03:18 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2008-09-25 17:03:18 +0000 |
commit | af4f9aa42157b8851737541c142a47b9793f2571 (patch) | |
tree | 6efefccfd5b98f0e90d7241e235ca9b2b178d3b4 | |
parent | 404898e1027b73d4cde03acddec69065ebba9727 (diff) | |
download | portage-af4f9aa42157b8851737541c142a47b9793f2571.tar.gz portage-af4f9aa42157b8851737541c142a47b9793f2571.tar.bz2 portage-af4f9aa42157b8851737541c142a47b9793f2571.zip |
change set expression syntax: operators now have a @ suffix (IOW: all operands must be prefixed with @) to maintain compability with existing set names containing hyphens
svn path=/main/trunk/; revision=11544
-rw-r--r-- | pym/_emerge/__init__.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index afc3f58e8..53be7e2d5 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -13391,9 +13391,11 @@ def expand_set_arguments(myfiles, myaction, root_config): del newargs newargs = [] - IS_OPERATOR = "/" - DIFF_OPERATOR = "-" - UNION_OPERATOR = "+" + # WARNING: all operators must be of equal length + IS_OPERATOR = "/@" + DIFF_OPERATOR = "-@" + UNION_OPERATOR = "+@" + for a in myfiles: if a.startswith(SETPREFIX): # support simple set operations (intersection, difference and union) @@ -13406,9 +13408,10 @@ def expand_set_arguments(myfiles, myaction, root_config): is_pos = expression.rfind(IS_OPERATOR) diff_pos = expression.rfind(DIFF_OPERATOR) union_pos = expression.rfind(UNION_OPERATOR) - s1 = expression[:max(is_pos, diff_pos, union_pos)] - s2 = expression[max(is_pos, diff_pos, union_pos)+1:] - op = expression[max(is_pos, diff_pos, union_pos)] + op_pos = max(is_pos, diff_pos, union_pos) + s1 = expression[:op_pos] + s2 = expression[op_pos+len(IS_OPERATOR):] + op = expression[op_pos:op_pos+len(IS_OPERATOR)] if not s2 in sets: display_missing_pkg_set(root_config, s2) return (None, 1) |