diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-11-04 16:02:47 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-11-04 16:02:47 +0000 |
commit | 7aee80de5c325d49fe29b6d21b3cb36aa28a2730 (patch) | |
tree | 5b133fd24f7f34de6f25e04f2258375268db8823 /libs/uvl | |
parent | 8d75d524f99be11e722ae05bd714450388659e4c (diff) |
* luci/libs/uvl: revert accidentally committed changes in dependency handler
Diffstat (limited to 'libs/uvl')
-rw-r--r-- | libs/uvl/luasrc/uvl/dependencies.lua | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libs/uvl/luasrc/uvl/dependencies.lua b/libs/uvl/luasrc/uvl/dependencies.lua index 5b67dffe4a..d19149e7ab 100644 --- a/libs/uvl/luasrc/uvl/dependencies.lua +++ b/libs/uvl/luasrc/uvl/dependencies.lua @@ -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 |