* luci/libs/uvl:
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 3 Sep 2008 02:08:38 +0000 (02:08 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 3 Sep 2008 02:08:38 +0000 (02:08 +0000)
- fix command line switches for uvl
- honour STRICT_UNKOWN_OPTIONS in luci.uvl._validate_option()

libs/uvl/luasrc/uvl.lua
libs/uvl/root/usr/bin/uvl

index e5a6c7569c16a31a16534aa69fbbe327a0f10618..908cfd7bd2dd91f2bc45a8d2f8eaecad5a637d85 100644 (file)
@@ -280,7 +280,11 @@ function UVL._validate_option( self, option, nodeps )
        self.beenthere[option:cid()] = true
 
        if not option:scheme() and not option:parent():scheme('dynamic') then
-               return false, option:error(ERR.OPT_UNKNOWN(option))
+               if STRICT_UNKNOWN_OPTIONS then
+                       return false, option:error(ERR.OPT_UNKNOWN(option))
+               else
+                       return true
+               end
 
        elseif option:scheme() then
                if option:scheme('required') and not option:value() then
index b859097fa20034a94a3dc573e91ca72f7f6c6327..0fe7a13a70e5180f51fc116c5cf62e07ae185313 100755 (executable)
@@ -185,13 +185,13 @@ Actions:
        os.exit(255)
 elseif arguments[1] == "verify" then
        luci.uvl.STRICT_UNKNOWN_SECTIONS =
-               ( options['no-strict-sections'] and false or true )
+               ( not options['no-strict-sections'] and true or false )
        luci.uvl.STRICT_UNKNOWN_OPTIONS =
-               ( options['no-strict-options'] and false or true )
+               ( not options['no-strict-options'] and true or false )
        luci.uvl.STRICT_EXTERNAL_VALIDATORS =
-               ( options['no-strict-validators'] and false or true )
+               ( not options['no-strict-validators'] and true or false )
        luci.uvl.STRICT_LIST_TYPE =
-               ( options['no-strict-lists'] and false or true )
+               ( not options['no-strict-lists'] and true or false )
 
        local uvl = luci.uvl.UVL(
                type(options.schemedir) == "string" and options.schemedir or nil