Moved luci.sys.libpath to luci.util
authorSteven Barth <steven@midlink.org>
Wed, 6 Aug 2008 20:20:40 +0000 (20:20 +0000)
committerSteven Barth <steven@midlink.org>
Wed, 6 Aug 2008 20:20:40 +0000 (20:20 +0000)
contrib/package/luci-addons/dist/etc/init.d/luci_fixtime
libs/cbi/luasrc/cbi.lua
libs/core/luasrc/sys.lua
libs/core/luasrc/util.lua
libs/web/luasrc/dispatcher.lua
libs/web/luasrc/i18n.lua
libs/web/luasrc/template.lua

index 3ca0038..681d9d7 100644 (file)
@@ -3,9 +3,9 @@
 START=05
 
 start() {
 START=05
 
 start() {
-       cat <<' EOF' | lua -l luci.fs -l luci.sys -
+       cat <<' EOF' | lua -l luci.fs -l luci.util -
                if (os.time() < 1000000000) then
                if (os.time() < 1000000000) then
-                       os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
+                       os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.util.libpath())))
                end
        EOF
 }
                end
        EOF
 }
index d5be48e..f81f7f1 100644 (file)
@@ -41,9 +41,9 @@ function load(cbimap)
        require("luci.fs")
        require("luci.i18n")
        require("luci.config")
        require("luci.fs")
        require("luci.i18n")
        require("luci.config")
-       require("luci.sys")
+       require("luci.util")
 
 
-       local cbidir = luci.sys.libpath() .. "/model/cbi/"
+       local cbidir = luci.util.libpath() .. "/model/cbi/"
        local func, err = loadfile(cbidir..cbimap..".lua")
 
        if not func then
        local func, err = loadfile(cbidir..cbimap..".lua")
 
        if not func then
index c291f67..14a2f29 100644 (file)
@@ -24,7 +24,7 @@ limitations under the License.
 
 ]]--
 
 
 ]]--
 
---- LuCI system utilities.
+--- LuCI Linux and POSIX system utilities.
 module("luci.sys", package.seeall)
 require("posix")
 require("luci.bits")
 module("luci.sys", package.seeall)
 require("posix")
 require("luci.bits")
@@ -70,12 +70,6 @@ function httpget(url, stream)
        return source("wget -qO- '"..url:gsub("'", "").."'")
 end
 
        return source("wget -qO- '"..url:gsub("'", "").."'")
 end
 
---- Returns the absolute path to LuCI base directory.
--- @return             String containing the directory path
-function libpath()
-       return luci.fs.dirname(require("luci.debug").__file__)
-end
-
 --- Returns the system load average values.
 -- @return     String containing the average load value 1 minute ago
 -- @return     String containing the average load value 5 minutes ago
 --- Returns the system load average values.
 -- @return     String containing the average load value 1 minute ago
 -- @return     String containing the average load value 5 minutes ago
index 2f6cfad..cd3534f 100644 (file)
@@ -612,6 +612,13 @@ function execl(command)
        return data
 end
 
        return data
 end
 
+--- Returns the absolute path to LuCI base directory.
+-- @return             String containing the directory path
+function libpath()
+       return luci.fs.dirname(require("luci.debug").__file__)
+end
+
+
 --
 -- Coroutine safe xpcall and pcall versions modified for Luci
 -- original version:
 --
 -- Coroutine safe xpcall and pcall versions modified for Luci
 -- original version:
index 576db36..840dbf3 100644 (file)
@@ -201,7 +201,7 @@ end
 
 --- Generate the dispatching index using the best possible strategy.
 function createindex()
 
 --- Generate the dispatching index using the best possible strategy.
 function createindex()
-       local path = luci.sys.libpath() .. "/controller/"
+       local path = luci.util.libpath() .. "/controller/"
        local suff = ".lua"
        
        if luci.util.copcall(require, "luci.fastindex") then
        local suff = ".lua"
        
        if luci.util.copcall(require, "luci.fastindex") then
index 5f0ee8a..84a8695 100644 (file)
@@ -26,10 +26,10 @@ limitations under the License.
 
 --- LuCI translation library.
 module("luci.i18n", package.seeall)
 
 --- LuCI translation library.
 module("luci.i18n", package.seeall)
-require("luci.sys")
+require("luci.util")
 
 table   = {}
 
 table   = {}
-i18ndir = luci.sys.libpath() .. "/i18n/"
+i18ndir = luci.util.libpath() .. "/i18n/"
 loaded  = {}
 context = luci.util.threadlocal()
 default = "en"
 loaded  = {}
 context = luci.util.threadlocal()
 default = "en"
index 659c721..907403f 100644 (file)
@@ -30,12 +30,13 @@ module("luci.template", package.seeall)
 require("luci.config")
 require("luci.util")
 require("luci.fs")
 require("luci.config")
 require("luci.util")
 require("luci.fs")
+require("luci.sys")
 require("luci.http")
 
 luci.config.template = luci.config.template or {}
 
 require("luci.http")
 
 luci.config.template = luci.config.template or {}
 
-viewdir    = luci.config.template.viewdir or luci.sys.libpath() .. "/view"
-compiledir = luci.config.template.compiledir or luci.sys.libpath() .. "/view"
+viewdir    = luci.config.template.viewdir or luci.util.libpath() .. "/view"
+compiledir = luci.config.template.compiledir or luci.util.libpath() .. "/view"
 
 
 -- Compile modes:
 
 
 -- Compile modes: