Merge pull request #402 from NeoRaider/json-empty-object 405/head 406/head 407/head 408/head
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 10 Jun 2015 08:20:49 +0000 (10:20 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 10 Jun 2015 08:20:49 +0000 (10:20 +0200)
luci-lib-json: ignore null keys to allow encoding empty objects

applications/luci-app-privoxy/Makefile
applications/luci-app-privoxy/luasrc/controller/privoxy.lua [changed mode: 0755->0644]
applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua [changed mode: 0755->0644]
applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm [changed mode: 0755->0644]
applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua
applications/luci-app-radicale/Makefile
applications/luci-app-radicale/luasrc/controller/radicale.lua [changed mode: 0755->0644]
applications/luci-app-radicale/luasrc/model/cbi/radicale.lua [changed mode: 0755->0644]
modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua
modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua

index bc2c57e..3d87a41 100644 (file)
@@ -10,7 +10,7 @@ PKG_NAME:=luci-app-privoxy
 
 # Version == major.minor.patch
 # increase "minor" on new functionality and "patch" on patches/optimization
-PKG_VERSION:=1.0.3
+PKG_VERSION:=1.0.4
 
 # Release == build
 # increase on changes of translation files
old mode 100755 (executable)
new mode 100644 (file)
index 9ffc404..58ba807
@@ -72,8 +72,7 @@ end
 
 -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>"
 function ipkg_ver_compare(ver1, comp, ver2)
-       if not ver1 or not (#ver1 > 0)
-       or not ver2 or not (#ver2 > 0)
+       if not ver1 or not ver2
        or not comp or not (#comp > 0) then return nil end
        -- correct compare string
        if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
@@ -90,33 +89,19 @@ function ipkg_ver_compare(ver1, comp, ver2)
        for i = 1, math.max(table.getn(av1),table.getn(av2)), 1  do
                local s1 = av1[i] or ""
                local s2 = av2[i] or ""
-               local n1 = tonumber(s1)
-               local n2 = tonumber(s2)
-
-               -- one numeric and other empty string then set other to 0
-               if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end
-               if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end
-
-               local nc = (n1 and n2)  -- numeric compare
-
-               if nc then
-                       -- first "not equal" found return true
-                       if comp == "~=" and (n1 ~= n2) then return true end
-                       -- first "lower" found return true
-                       if (comp == "<" or comp == "<=") and (n1 < n2) then return true end
-                       -- first "greater" found return true
-                       if (comp == ">" or comp == ">=") and (n1 > n2) then return true end
-                       -- not equal then return false
-                       if (n1 ~= n2) then return false end
-               else
-                       if comp == "~=" and (s1 ~= s2) then return true end
-                       if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
-                       if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
-                       if (s1 ~= s2) then return false end
-               end
+
+               -- first "not equal" found return true
+               if comp == "~=" and (s1 ~= s2) then return true end
+               -- first "lower" found return true
+               if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
+               -- first "greater" found return true
+               if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
+               -- not equal then return false
+               if (s1 ~= s2) then return false end
        end
-       -- all equal then true
-       return true
+
+       -- all equal and not compare greater or lower then true
+       return not (comp == "<" or comp == ">")
 end
 
 -- read version information for given package if installed
old mode 100755 (executable)
new mode 100644 (file)
index c009313..c415f8e
@@ -39,6 +39,7 @@ if not nixio.fs.access("/etc/config/privoxy") or not VEROK then
        local f = SimpleForm("_no_config")
        f.title = TITLE
        f.description = DESC
+       f.embedded = true
        f.submit = false
        f.reset  = false
 
index 99a884f..a8ea57e 100644 (file)
@@ -53,25 +53,6 @@ dsth.rmempty = true
 dsth:value("", translate("all"))
 wa.cbi_add_knownips(dsth)
 
-l7 = s:option(ListValue, "layer7", translate("Service"))
-l7.rmempty = true
-l7:value("", translate("all"))
-
-local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
-if pats then
-       local l
-       while true do
-               l = pats:read("*l")
-               if not l then break end
-
-               l = l:match("([^/]+)%.pat$")
-               if l then
-                       l7:value(l)
-               end
-       end
-       pats:close()
-end
-
 p = s:option(Value, "proto", translate("Protocol"))
 p:value("", translate("all"))
 p:value("tcp", "TCP")
index 07998ae..960618d 100644 (file)
@@ -10,7 +10,7 @@ PKG_NAME:=luci-app-radicale
 
 # Version == major.minor.patch
 # increase "minor" on new functionality and "patch" on patches/optimization
-PKG_VERSION:=1.0.0
+PKG_VERSION:=1.0.1
 
 # Release == build
 # increase on changes of translation files
old mode 100755 (executable)
new mode 100644 (file)
index 662c60d..d384b00
@@ -122,8 +122,7 @@ end
 
 -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>"
 function ipkg_ver_compare(ver1, comp, ver2)
-       if not ver1 or not (#ver1 > 0)
-       or not ver2 or not (#ver2 > 0)
+       if not ver1 or not ver2
        or not comp or not (#comp > 0) then return nil end
        -- correct compare string
        if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
@@ -140,33 +139,19 @@ function ipkg_ver_compare(ver1, comp, ver2)
        for i = 1, math.max(table.getn(av1),table.getn(av2)), 1  do
                local s1 = av1[i] or ""
                local s2 = av2[i] or ""
-               local n1 = tonumber(s1)
-               local n2 = tonumber(s2)
-
-               -- one numeric and other empty string then set other to 0
-               if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end
-               if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end
-
-               local nc = (n1 and n2)  -- numeric compare
-
-               if nc then
-                       -- first "not equal" found return true
-                       if comp == "~=" and (n1 ~= n2) then return true end
-                       -- first "lower" found return true
-                       if (comp == "<" or comp == "<=") and (n1 < n2) then return true end
-                       -- first "greater" found return true
-                       if (comp == ">" or comp == ">=") and (n1 > n2) then return true end
-                       -- not equal then return false
-                       if (n1 ~= n2) then return false end
-               else
-                       if comp == "~=" and (s1 ~= s2) then return true end
-                       if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
-                       if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
-                       if (s1 ~= s2) then return false end
-               end
+
+               -- first "not equal" found return true
+               if comp == "~=" and (s1 ~= s2) then return true end
+               -- first "lower" found return true
+               if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
+               -- first "greater" found return true
+               if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
+               -- not equal then return false
+               if (s1 ~= s2) then return false end
        end
-       -- all equal then true
-       return true
+
+       -- all equal and not compare greater or lower then true
+       return not (comp == "<" or comp == ">")
 end
 
 -- read version information for given package if installed
index 148bdcb..b604f6b 100644 (file)
@@ -15,7 +15,7 @@ TZ = {
        { 'Africa/Blantyre', 'CAT-2' },
        { 'Africa/Brazzaville', 'WAT-1' },
        { 'Africa/Bujumbura', 'CAT-2' },
-       { 'Africa/Cairo', 'EET-2EEST,M4.5.4/24,M9.5.4/24' },
+       { 'Africa/Cairo', 'EET-2' },
        { 'Africa/Casablanca', 'WET0WEST,M3.5.0,M10.5.0/3' },
        { 'Africa/Ceuta', 'CET-1CEST,M3.5.0,M10.5.0/3' },
        { 'Africa/Conakry', 'GMT0' },
@@ -55,7 +55,7 @@ TZ = {
        { 'Africa/Tripoli', 'EET-2' },
        { 'Africa/Tunis', 'CET-1' },
        { 'Africa/Windhoek', 'WAT-1WAST,M9.1.0,M4.1.0' },
-       { 'America/Adak', 'HAST10HADT,M3.2.0,M11.1.0' },
+       { 'America/Adak', 'HST10HDT,M3.2.0,M11.1.0' },
        { 'America/Anchorage', 'AKST9AKDT,M3.2.0,M11.1.0' },
        { 'America/Anguilla', 'AST4' },
        { 'America/Antigua', 'AST4' },
index fe3f860..24429ac 100644 (file)
@@ -9,11 +9,10 @@ OFFSET = {
        wat   =   3600, -- WAT
        cat   =   7200, -- CAT
        eet   =   7200, -- EET
-       eest  =  10800, -- EEST
        wet   =      0, -- WET
        sast  =   7200, -- SAST
-       hast  = -36000, -- HAST
-       hadt  = -32400, -- HADT
+       hst   = -36000, -- HST
+       hdt   = -32400, -- HDT
        akst  = -32400, -- AKST
        akdt  = -28800, -- AKDT
        ast   = -14400, -- AST
@@ -147,7 +146,6 @@ OFFSET = {
        galt  = -21600, -- GALT
        gamt  = -32400, -- GAMT
        sbt   =  39600, -- SBT
-       hst   = -36000, -- HST
        lint  =  50400, -- LINT
        kost  =  39600, -- KOST
        mht   =  43200, -- MHT