diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-04-04 22:54:16 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-04-04 22:54:16 +0000 |
commit | 9835296ba2623b5c87624da3a8ba5f43595297d0 (patch) | |
tree | 71ab8933e418c25f4b283ff630d643154c168c21 /libs/cbi/luasrc/cbi.lua | |
parent | f3deef9ec570d49795346516d34c1b42fb416fde (diff) |
trunk: prepare LuCI to handle .lua.gz files
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index ebca729bb..18d84e52f 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -59,12 +59,15 @@ function load(cbimap, ...) local upldir = "/lib/uci/upload/" local cbidir = luci.util.libpath() .. "/model/cbi/" - assert(luci.fs.stat(cbimap) or luci.fs.stat(cbidir..cbimap..".lua"), - "Model not found!") + assert(luci.fs.stat(cbimap) or + luci.fs.stat(cbidir..cbimap..".lua") or + luci.fs.stat(cbidir..cbimap..".lua.gz"), + "Model not found!") local func, err = loadfile(cbimap) if not func then - func, err = loadfile(cbidir..cbimap..".lua") + func, err = loadfile(cbidir..cbimap..".lua") or + loadfile(cbidir..cbimap..".lua.gz") end assert(func, err) |