From: Gordon Hecker Date: Tue, 19 Jan 2010 16:55:15 +0000 (+0100) Subject: transport: cleanup: turn into proper lua module X-Git-Tag: e2factory-2.3.4pre1~42 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=8e3c49de9bc8efff6f4d9968f91aec977dcc6d23;p=e2factory.git transport: cleanup: turn into proper lua module Signed-off-by: Gordon Hecker --- diff --git a/generic/transport.lua b/generic/transport.lua index 191f43b..fa7e827 100644 --- a/generic/transport.lua +++ b/generic/transport.lua @@ -25,6 +25,7 @@ along with this program. If not, see . ]] +module("transport", package.seeall) require("buildconfig") local tools = { @@ -62,7 +63,7 @@ local tools = { --- get a tool command -- @param name string: the tool name -- @return string: the tool command, nil on error -local function get_tool(name) +function get_tool(name) if not tools[name] then e2lib.bomb("looking up invalid tool: " .. tostring(name)) end @@ -72,7 +73,7 @@ end --- get tool flags -- @param name string: the tool name -- @return string: the tool flags -local function get_tool_flags(name) +function get_tool_flags(name) if not tools[name] then e2lib.bomb("looking up flags for invalid tool: " .. tostring(name)) @@ -86,7 +87,7 @@ end -- @param flags string: the new tool flags. Optional. -- @return bool -- @return nil, an error string on error -local function set_tool(name, value, flags) +function set_tool(name, value, flags) if not tools[name] then return false, "invalid tool setting" end @@ -408,13 +409,3 @@ function init() end return true, nil end - -transport = {} -transport.check_tool = check_tool -transport.get_tool = get_tool -transport.get_tool_flags = get_tool_flags -transport.set_tool = set_tool -transport.init = init -transport.fetch_file = fetch_file -transport.push_file = push_file -transport.file_path = file_path