diff options
author | Marius Mauch <genone@gentoo.org> | 2008-09-28 16:08:50 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2008-09-28 16:08:50 +0000 |
commit | 918421b4cd656cae82476b17682f3300020687bf (patch) | |
tree | 06bd47b0e6ffa791905e27663464b57259d715f6 /pym/_emerge | |
parent | c0d0d98f99d8473e6f82ab77bb42ebaba07d4072 (diff) | |
download | portage-918421b4cd656cae82476b17682f3300020687bf.tar.gz portage-918421b4cd656cae82476b17682f3300020687bf.tar.bz2 portage-918421b4cd656cae82476b17682f3300020687bf.zip |
implement set arguments to reconfigure and create package sets on the commandline
svn path=/main/trunk/; revision=11581
Diffstat (limited to 'pym/_emerge')
-rw-r--r-- | pym/_emerge/__init__.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 09a92f23a..39ab9f661 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -13395,12 +13395,38 @@ def expand_set_arguments(myfiles, myaction, root_config): myfiles = newargs del newargs newargs = [] + + # separators for set arguments + ARG_START = "{" + ARG_END = "}" + for i in range(0, len(myfiles)): + if myfiles[i].startswith(SETPREFIX): + x = myfiles[i][len(SETPREFIX):] + start = x.find(ARG_START) + end = x.find(ARG_END) + if start > 0 and start < end: + namepart = x[:start] + argpart = x[start+1:end] + + # TODO: implement proper quoting + args = argpart.split(",") + options = {} + for a in args: + if "=" in a: + k, v = a.split("=", 1) + options[k] = v + else: + options[a] = "True" + setconfig.update(namepart, options) + myfiles[i] = SETPREFIX + namepart + sets = setconfig.getSets() + # 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) |