From 9835296ba2623b5c87624da3a8ba5f43595297d0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 4 Apr 2009 22:54:16 +0000 Subject: trunk: prepare LuCI to handle .lua.gz files --- libs/cbi/luasrc/cbi.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libs/cbi/luasrc') 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) -- cgit v1.2.3