summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-07-14 12:19:00 +0200
committerHans Hagen <pragma@wxs.nl>2011-07-14 12:19:00 +0200
commit15b10d973290abaf01211aa5c68b6026ba1b02ac (patch)
treeaee910952c51e6eee4f0c390444e469304b742c9 /scripts
parentd6b1bbb30b5d03582599faf4132630d46275bb97 (diff)
downloadcontext-15b10d973290abaf01211aa5c68b6026ba1b02ac.tar.gz
beta 2011.07.14 12:19
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-update.lua26
1 files changed, 19 insertions, 7 deletions
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