* luci/libs/uvl: revert accidentally committed changes in dependency handler
This commit is contained in:
parent
8d75d524f9
commit
7aee80de5c
1 changed files with 4 additions and 11 deletions
|
@ -37,7 +37,7 @@ function _parse_reference( r, c, s, o )
|
|||
for v in r:gmatch("[^.]+") do
|
||||
ref[#ref+1] = (v:gsub( "%$(.+)", vars ))
|
||||
end
|
||||
|
||||
|
||||
if #ref < 2 then
|
||||
table.insert(ref, 1, s or '$section')
|
||||
end
|
||||
|
@ -81,11 +81,7 @@ function check( self, object, nodeps )
|
|||
|
||||
for _, dep in ipairs(object:scheme('depends')) do
|
||||
local subcondition = true
|
||||
local score = 0
|
||||
|
||||
for k, v in util.spairs(
|
||||
dep, function(a, b) return type(dep[a]) == "string" end
|
||||
) do
|
||||
for k, v in pairs(dep) do
|
||||
-- XXX: better error
|
||||
local ref = _parse_reference( k, unpack(object.cref) )
|
||||
|
||||
|
@ -107,13 +103,10 @@ function check( self, object, nodeps )
|
|||
derr:child(
|
||||
type(v) == "boolean"
|
||||
and ERR.DEP_NOVALUE(option, depstr)
|
||||
or ERR.DEP_NOTEQUAL(option, {depstr, v}),
|
||||
score
|
||||
or ERR.DEP_NOTEQUAL(option, {depstr, v})
|
||||
)
|
||||
|
||||
--break
|
||||
else
|
||||
score = score + ( type(v) == "boolean" and 1 or 10 )
|
||||
break
|
||||
end
|
||||
else
|
||||
subcondition = false
|
||||
|
|
Loading…
Reference in a new issue