summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-04-05 17:44:57 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-04-05 17:44:57 +0000
commit119aeff2c70e9890b788a9a4e8b6300f64668280 (patch)
treead165bd165856e9755b76c419ee881eab3b879d2
parentf77d92b2bee1b2878b1b08b09763a9f47606503d (diff)
luci-0.9: fix various uvl issues
-rw-r--r--libs/uvl/luasrc/uvl.lua2
-rw-r--r--libs/uvl/luasrc/uvl/errors.lua6
-rwxr-xr-xlibs/uvl/root/usr/bin/uvl2
3 files changed, 5 insertions, 5 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua
index d2ea4bd2c2..f9a93e6d18 100644
--- a/libs/uvl/luasrc/uvl.lua
+++ b/libs/uvl/luasrc/uvl.lua
@@ -278,7 +278,7 @@ function UVL._validate_section( self, section )
if STRICT_UNKNOWN_OPTIONS and not section:scheme('dynamic') then
for k, v in pairs(section:config()) do
local oo = section:option(k)
- if k:byte(1) == 46 and not self.beenthere[oo:cid()] then
+ if k:byte(1) ~= 46 and not self.beenthere[oo:cid()] then
section:error(ERR('OPT_UNKNOWN', oo))
end
end
diff --git a/libs/uvl/luasrc/uvl/errors.lua b/libs/uvl/luasrc/uvl/errors.lua
index fa177fb763..aa13317cc9 100644
--- a/libs/uvl/luasrc/uvl/errors.lua
+++ b/libs/uvl/luasrc/uvl/errors.lua
@@ -19,8 +19,8 @@ local uvl = require "luci.uvl"
local util = require "luci.util"
local string = require "string"
-local luci, tonumber, unpack, ipairs, type =
- luci, tonumber, unpack, ipairs, type
+local luci, tonumber, tostring, unpack, ipairs, type =
+ luci, tonumber, tostring, unpack, ipairs, type
module "luci.uvl.errors"
@@ -128,7 +128,7 @@ function error.string(self,pad)
:gsub("%%s", self.section or '(nil)')
:gsub("%%S", self.stype or '(nil)')
:gsub("%%o", self.option or '(nil)')
- :gsub("%%v", self.value or '(nil)')
+ :gsub("%%v", self.value and tostring(self.value) or '(nil)')
:gsub("%%t", self.object and self.object:type() or '(nil)' )
:gsub("%%T", self.object and self.object:title() or '(nil)' )
:gsub("%%([1-9])", function(n) return self.args[tonumber(n)] or '(nil)' end)
diff --git a/libs/uvl/root/usr/bin/uvl b/libs/uvl/root/usr/bin/uvl
index e5db5c304e..01813b3f3a 100755
--- a/libs/uvl/root/usr/bin/uvl
+++ b/libs/uvl/root/usr/bin/uvl
@@ -216,7 +216,7 @@ elseif arguments[1] == "verify" or arguments[1] == "verify-scheme" then
)
ok, err = uvl:validate_config( cso[1], uci:get_all(cso[1]) )
- if err then err.code = luci.uvl.errors.ERR_SCHEME end
+ if err then err.code = 'SCHEME' end
else
ok, err = uvl:validate( unpack(cso) )
end