From 4617a0881e7f28a3f449ba3d93b0155d7667186a Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Thu, 30 Apr 2009 16:20:48 +0200 Subject: [PATCH] call global tools with LUA_PATH and LUA_CPATH set. This makes setting package.path and package.cpath in the code obsolete. Signed-off-by: Gordon Hecker Conflicts: global/e2-install-e2.lua.in --- global/e2-create-project.lua.in | 3 --- global/e2-fetch-project.lua.in | 8 +++----- global/e2-install-e2.lua.in | 5 ----- global/e2.lua.in | 5 ++++- global/e2global.lua.in | 2 +- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/global/e2-create-project.lua.in b/global/e2-create-project.lua.in index a2e7de8..f006022 100755 --- a/global/e2-create-project.lua.in +++ b/global/e2-create-project.lua.in @@ -25,9 +25,6 @@ along with this program. If not, see . ]] -package.path="@LIBDIR@/?.lc;@LIBDIR@/?.lua" -package.cpath="@LIBDIR@/?.so" - require("e2global") e2lib.init() diff --git a/global/e2-fetch-project.lua.in b/global/e2-fetch-project.lua.in index e21f4c1..56c9534 100755 --- a/global/e2-fetch-project.lua.in +++ b/global/e2-fetch-project.lua.in @@ -25,12 +25,8 @@ along with this program. If not, see . ]] -e2_install_e2 = "@LIBEXECDIR@/e2-lua-@LUA_VERSION@ @TOOLDIR@/e2-install-e2" - -package.path="@LIBDIR@/?.lc;@LIBDIR@/?.lua" -package.cpath="@LIBDIR@/?.so" - require("e2global") + e2lib.init() local e = new_error("fetching project failed") local doc = [[ @@ -183,6 +179,8 @@ if not rc then end -- call e2-install-e2 +e2_install_e2 = string.format("'%s' '%s/e2-install-e2'", + getinstallpath("LUA"), getinstallpath("TOOLDIR")) rc, re = e2lib.callcmd_log(e2_install_e2) if not rc then e:append("installing local e2 failed") diff --git a/global/e2-install-e2.lua.in b/global/e2-install-e2.lua.in index ff359c8..a7d56ed 100755 --- a/global/e2-install-e2.lua.in +++ b/global/e2-install-e2.lua.in @@ -25,11 +25,6 @@ along with this program. If not, see . ]] -package.path = "@LIBDIR@/?.lc;@LIBDIR@/?.lua" -package.cpath = "@LIBDIR@/?.so" - -local install_prefix = "@E2_PREFIX@" - require("e2global") e2lib.init() diff --git a/global/e2.lua.in b/global/e2.lua.in index e4c9546..40ce7f8 100755 --- a/global/e2.lua.in +++ b/global/e2.lua.in @@ -81,7 +81,10 @@ end if e2util.stat(e2call.globaltool) then e2call.tool = e2call.globaltool - cmd = "@LIBEXECDIR@/e2-lua-@LUA_VERSION@ " .. e2call.tool .. " " .. e2call.arg_string + env = "LUA_PATH='@LIBDIR@/?.lc;@LIBDIR@/?.lua'" .. + "LUA_CPATH='@LIBDIR@/?.so'" + lua = "@LIBEXECDIR@/e2-lua-@LUA_VERSION@" + cmd = string.format("%s %s %s %s", env, lua, e2call.tool, e2call.arg_string) elseif not root then e2lib.abort(e2call.toolname .. " is not a global tool and we're not in a project environment") diff --git a/global/e2global.lua.in b/global/e2global.lua.in index fc90950..8ec353b 100644 --- a/global/e2global.lua.in +++ b/global/e2global.lua.in @@ -47,7 +47,7 @@ install [ "BINDIR" ] = "@BINDIR@" install [ "LIBDIR" ] = "@LIBDIR@" install [ "LIBEXECDIR" ] = "@LIBEXECDIR@" install [ "TOOLDIR" ] = "@TOOLDIR@" - +install [ "LUA" ] = "@LIBEXECDIR@/e2-lua-@LUA_VERSION@" -- getinstallpath(var) -- -- 2.39.5