From 06c7a7fdaac34512cdc3ff250dec5b1a7ab3052a Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 14 Jul 2011 13:40:13 +0300 Subject: beta 2011.07.14 12:19 --- scripts/context/lua/mtx-update.lua | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index 099a7218f..937fed21b 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -542,18 +542,30 @@ if scripts.savestate then for r in gmatch(environment.argument("repository") or "current","([^, ]+)") do if valid[r] then states.set("repositories." .. r, true) end end + local valid = scripts.update.engines - for r in gmatch(environment.argument("engine") or "all","([^, ]+)") do - if r == "all" then - for k, v in next, valid do - if k ~= "all" then - states.set("engines." .. k, true) + local engine = environment.argument("engine") or "" + if engine == "" then + local e = states.get("engines") + if not e or not next(e) then + engine = "all" + end + end + if engine ~= "" then + for r in gmatch(engine,"([^, ]+)") do + if r == "all" then + for k, v in next, valid do + if k ~= "all" then + states.set("engines." .. k, true) + end end + break + elseif valid[r] then + states.set("engines." .. r, true) end - elseif valid[r] then - states.set("engines." .. r, true) end end + local valid = scripts.update.platforms for r in gmatch(environment.argument("platform") or os.platform,"([^, ]+)") do if valid[r] then states.set("platforms." .. r, true) end -- cgit v1.2.3