From af4f9aa42157b8851737541c142a47b9793f2571 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Thu, 25 Sep 2008 17:03:18 +0000 Subject: [PATCH] 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 --- pym/_emerge/__init__.py | 15 +++++++++------ 1 file 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) -- 2.26.2