]> git.e2factory.org Git - e2factory.git/commitdiff
Require the transport module where needed
authorTobias Ulmer <tu@emlix.com>
Tue, 7 Aug 2012 10:37:32 +0000 (12:37 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 8 Aug 2012 12:44:00 +0000 (14:44 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/cache.lua
generic/transport.lua
local/e2build.lua
local/e2tool.lua

index 85e37d24b81f2363d6641f69b465b62af8634bff..61b35cc63a67d2a86e852d54b7945f3451fb2d5a 100644 (file)
@@ -27,7 +27,7 @@
 
 local cache = {}
 require("e2lib")
-require("transport")
+local transport = require("transport")
 local url = require("url")
 
 --- cache
index 0a5475902b2573cc0656658fcd7046d69355e04f..8142a1ec2930850fa5eac2ee15069cbb4eb44588 100644 (file)
@@ -25,7 +25,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ]]
 
-module("transport", package.seeall)
+local transport = {}
 local url = require("url")
 
 --- call rsync with appropriate rsh argument according to the tools
@@ -133,7 +133,7 @@ end
 -- @param destname filename of the fetched file
 -- @return true on success, false on error
 -- @return an error object on failure
-function fetch_file(surl, location, destdir, destname)
+function transport.fetch_file(surl, location, destdir, destname)
        e2lib.log(4, string.format("%s: %s %s %s", "fetch_file()", surl,
                                                        location, destdir))
        if not destname then
@@ -223,7 +223,7 @@ end
 -- @param try_hardlink bool: optimize by trying to hardlink instead of copying
 -- @return true on success, false on error
 -- @return nil, an error string on error
-function push_file(sourcefile, durl, location, push_permissions, try_hardlink)
+function transport.push_file(sourcefile, durl, location, push_permissions, try_hardlink)
        e2lib.log(4, string.format("%s: %s %s %s %s", "transport.push_file()",
                sourcefile, durl, location, tostring(push_permissions)))
        local rc, e
@@ -342,7 +342,7 @@ end
 -- @param location location relative to the server url
 -- @return true on success, false on error
 -- @return nil, an error string on error
-function file_path(surl, location)
+function transport.file_path(surl, location)
        e2lib.log(4, string.format("%s: %s %s", "file_path()", surl,
                                                        location))
        local e = new_error("can't get path to file")
@@ -356,3 +356,5 @@ function file_path(surl, location)
        local path = string.format("/%s/%s", u.path, location)
        return path
 end
+
+return transport
index 95345834131aa98dc85bb51d37545da8fe2411d0..d108af9c6c4fda018e6360efcdf1c6b9a227dcea 100644 (file)
@@ -28,6 +28,7 @@
 -- e2build.lua -*- Lua -*-
 
 module("e2build", package.seeall)
+local transport = require("transport")
 
 --- cache a result
 -- @param info
index 9a8ad34ba9c2b6f34e4291198a44fe4eb0a5e1ca..66f5d2e5a0b4a4b7dfc305086fdfb3dfdca6aebc 100644 (file)
@@ -40,7 +40,6 @@ require("git")
 require("cvs")
 require("svn")
 require("cache")
-require("transport")
 require("tools")
 require("environment")
 require("plugin")