summaryrefslogtreecommitdiffhomepage
path: root/libs/uci
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-06-07 07:58:35 +0000
committerSteven Barth <steven@midlink.org>2008-06-07 07:58:35 +0000
commita7a2afdb0a51f28a716d34698152863c59eaf0ca (patch)
tree22e9246e786f2f434a89a8d7db820c20668493a6 /libs/uci
parent0eefbbe91d4aa69559eecdc7203e6c52565fc8a2 (diff)
* libs/uci: Fixed uci.delete_all
* Fixed Freifunk wizard
Diffstat (limited to 'libs/uci')
-rw-r--r--libs/uci/luasrc/model/uci.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/uci/luasrc/model/uci.lua b/libs/uci/luasrc/model/uci.lua
index 20bc0495c..bd6aba41a 100644
--- a/libs/uci/luasrc/model/uci.lua
+++ b/libs/uci/luasrc/model/uci.lua
@@ -27,6 +27,7 @@ local uci = require("uci")
local util = require("luci.util")
local setmetatable, rawget, rawset = setmetatable, rawget, rawset
local error, pairs, ipairs, tostring = error, pairs, ipairs, tostring
+local table, print = table, print
module("luci.model.uci", function(m) setmetatable(m, {__index = uci}) end)
@@ -37,16 +38,16 @@ savedir_state = "/var/state"
function delete_all(config, type, comparator)
local del = {}
-
- foreach(config, type,
- function (section)
+ local function helper (section)
if not comparator or comparator(section) then
table.insert(del, section[".name"])
end
- end)
-
+ end
+
+ foreach(config, type, helper)
+
for i, j in ipairs(del) do
- uci.delete(config, j)
+ delete(config, j)
end
end