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 3ca003887d60192e5a63607377bc1db690917759..681d9d7898bc33a8c2d2a20c1c5e8dc3937814d2 100644 (file)
@@ -3,9 +3,9 @@
 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
-                       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
 }
index d5be48edba96c9133c0584175226b5b19b0701c0..f81f7f1b9424a6a79d9175c976558bc8d9a8dbf5 100644 (file)
@@ -41,9 +41,9 @@ function load(cbimap)
        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
index c291f678961ee2c98dad87d529405bb3f05ea63b..14a2f294f3feca2d91d41f53d466cbbbf158a537 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")
@@ -70,12 +70,6 @@ function httpget(url, stream)
        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
index 2f6cfad4c21a8f1e06e01a0343be4b9111946029..cd3534f4f10aa3f9ee164b1b01135310570b2655 100644 (file)
@@ -612,6 +612,13 @@ function execl(command)
        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:
index 576db36b417cbea5e99f6bccfdb37859ad4afbdf..840dbf3c26aec4fd33671e71b37209fa5bc2b5fe 100644 (file)
@@ -201,7 +201,7 @@ end
 
 --- 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
index 5f0ee8a0110de4c412ff168637ad00afd1db6dfa..84a869539715096a55007bf9e90ee0ebab1c8090 100644 (file)
@@ -26,10 +26,10 @@ limitations under the License.
 
 --- LuCI translation library.
 module("luci.i18n", package.seeall)
-require("luci.sys")
+require("luci.util")
 
 table   = {}
-i18ndir = luci.sys.libpath() .. "/i18n/"
+i18ndir = luci.util.libpath() .. "/i18n/"
 loaded  = {}
 context = luci.util.threadlocal()
 default = "en"
index 659c7216d8ebc588fdfa1eeee085d55a2a18f65c..907403fcbba7d4ce79ff76475e3f5474017e571d 100644 (file)
@@ -30,12 +30,13 @@ module("luci.template", package.seeall)
 require("luci.config")
 require("luci.util")
 require("luci.fs")
+require("luci.sys")
 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: