* luci/libs/uvl: revert accidentally committed changes in dependency handler
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 4 Nov 2008 16:02:47 +0000 (16:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 4 Nov 2008 16:02:47 +0000 (16:02 +0000)
libs/uvl/luasrc/uvl/dependencies.lua

index 5b67dff..d19149e 100644 (file)
@@ -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