summaryrefslogtreecommitdiff
path: root/lua_scripts
diff options
context:
space:
mode:
authorLauri Aarnio <Lauri.Aarnio@iki.fi>2008-09-17 18:17:19 +0300
committerLauri Leukkunen <lle@rahina.org>2008-09-27 00:02:42 +0300
commit104871d02b12d59c0f2ce07af8db7366b2609588 (patch)
treea86af5019c86170b14490b728b1ba5b681c02f5f /lua_scripts
parent86678b08e80573b11870e8b2b9031a89bb108fad (diff)
Removed all calls to os.getenv() from pathmapping scripts - added several variables to sb2-session.conf (but didn't remove the environment variables yet)
Diffstat (limited to 'lua_scripts')
-rw-r--r--lua_scripts/pathmaps/emulate/00_default.lua13
-rw-r--r--lua_scripts/pathmaps/install/00_default.lua21
-rw-r--r--lua_scripts/pathmaps/maemo/00_default.lua27
-rw-r--r--lua_scripts/pathmaps/simple/00_default.lua15
4 files changed, 25 insertions, 51 deletions
diff --git a/lua_scripts/pathmaps/emulate/00_default.lua b/lua_scripts/pathmaps/emulate/00_default.lua
index 20fedb0..85211e3 100644
--- a/lua_scripts/pathmaps/emulate/00_default.lua
+++ b/lua_scripts/pathmaps/emulate/00_default.lua
@@ -3,11 +3,6 @@
sb1_compat_dir = sbox_target_root .. "/scratchbox1-compat"
-sb2_session_dir = os.getenv("SBOX_SESSION_DIR")
-if (not sb2_session_dir) then
- sb2_session_dir = "/tmp"
-end
-
mapall_chain = {
next_chain = nil,
binary = nil,
@@ -23,16 +18,16 @@ mapall_chain = {
map_to = sb1_compat_dir },
--
- {prefix = sb2_session_dir, use_orig_path = true},
- {prefix = "/tmp", map_to = sb2_session_dir},
+ {prefix = session_dir, use_orig_path = true},
+ {prefix = "/tmp", map_to = session_dir},
--
{prefix = "/dev", use_orig_path = true},
{prefix = "/proc", use_orig_path = true},
{prefix = "/sys", use_orig_path = true},
- {prefix = os.getenv("HOME") .. "/.scratchbox2",
+ {prefix = sbox_user_home_dir .. "/.scratchbox2",
use_orig_path = true},
- {prefix = os.getenv("SBOX_DIR") .. "/share/scratchbox2",
+ {prefix = sbox_dir .. "/share/scratchbox2",
use_orig_path = true},
{prefix = "/etc/resolv.conf", use_orig_path = true},
diff --git a/lua_scripts/pathmaps/install/00_default.lua b/lua_scripts/pathmaps/install/00_default.lua
index a31a7fb..e41d8b6 100644
--- a/lua_scripts/pathmaps/install/00_default.lua
+++ b/lua_scripts/pathmaps/install/00_default.lua
@@ -10,12 +10,7 @@ else
tools_target = "/"
end
-sb2_session_dir = os.getenv("SBOX_SESSION_DIR")
-if (not sb2_session_dir) then
- sb2_session_dir = "/tmp"
-end
-
-interp_wrapper = os.getenv("SBOX_DIR") .. "/bin/sb2-interp-wrapper"
+interp_wrapper = sbox_dir .. "/bin/sb2-interp-wrapper"
default_chain = {
next_chain = nil,
@@ -34,14 +29,14 @@ default_chain = {
{ prefix = "/proc", use_orig_path = true },
{ prefix = "/sys", use_orig_path = true },
- { prefix = sb2_session_dir, use_orig_path = true },
- { prefix = "/tmp", map_to = sb2_session_dir },
+ { prefix = session_dir, use_orig_path = true },
+ { prefix = "/tmp", map_to = session_dir },
- { prefix = os.getenv("HOME"), use_orig_path = true },
- { prefix = os.getenv("SBOX_WORKDIR"), use_orig_path = true },
- { prefix = os.getenv("SBOX_DIR") .. "/share/scratchbox2", use_orig_path = true, readonly = true },
- { prefix = os.getenv("SBOX_DIR") .. "/bin", use_orig_path = true, readonly = true },
- { prefix = os.getenv("SBOX_TARGET_TOOLCHAIN_DIR"), use_orig_path = true, readonly = true },
+ { prefix = sbox_user_home_dir, use_orig_path = true },
+ { prefix = sbox_workdir, use_orig_path = true },
+ { prefix = sbox_dir .. "/share/scratchbox2", use_orig_path = true, readonly = true },
+ { prefix = sbox_dir .. "/bin", use_orig_path = true, readonly = true },
+ { prefix = sbox_target_toolchain_dir, use_orig_path = true, readonly = true },
{ prefix = "/", map_to = target_root },
}
diff --git a/lua_scripts/pathmaps/maemo/00_default.lua b/lua_scripts/pathmaps/maemo/00_default.lua
index f672437..cd9a8fe 100644
--- a/lua_scripts/pathmaps/maemo/00_default.lua
+++ b/lua_scripts/pathmaps/maemo/00_default.lua
@@ -6,18 +6,7 @@ if (not tools) then
tools = "/"
end
-sb2_home_dir = os.getenv("HOME") .. "/.scratchbox2/"
-sb2_share_dir = sb2_home_dir .. os.getenv("SBOX_TARGET") .. "/share"
-
-sb2_session_dir = os.getenv("SBOX_SESSION_DIR")
-if (not sb2_session_dir) then
- sb2_session_dir = "/tmp"
-end
-
-home_dir = os.getenv("HOME")
-if (home_dir == nil) then
- home_dir = "/home/unknown_user"
-end
+sb2_share_dir = sbox_user_home_dir.."/.scratchbox2/"..sbox_target.."/share"
-- =========== Exec policies: ===========
--
@@ -299,8 +288,8 @@ simple_chain = {
-- -----------------------------------------------
-- 85. /tmp
- {prefix = sb2_session_dir, use_orig_path = true},
- {prefix = "/tmp", map_to = sb2_session_dir},
+ {prefix = session_dir, use_orig_path = true},
+ {prefix = "/tmp", map_to = session_dir},
-- -----------------------------------------------
-- 90. Top-level directories that must not be mapped:
@@ -358,14 +347,14 @@ simple_chain = {
qemu_chain = {
next_chain = nil,
- binary = basename(os.getenv("SBOX_CPUTRANSPARENCY_METHOD")),
+ binary = basename(sbox_cputransparency_method),
rules = {
{prefix = "/lib", map_to = target_root},
{prefix = "/usr/lib", map_to = target_root},
{prefix = "/usr/local/lib", map_to = target_root},
- {prefix = sb2_session_dir, use_orig_path = true},
- {prefix = "/tmp", map_to = sb2_session_dir},
+ {prefix = session_dir, use_orig_path = true},
+ {prefix = "/tmp", map_to = session_dir},
{prefix = "/dev", use_orig_path = true},
{prefix = "/proc", use_orig_path = true},
@@ -402,11 +391,11 @@ maemo_exec_policies = {
rules = {
-- ~/bin proobably contains programs for the host OS:
- {prefix = home_dir.."/bin", exec_policy = exec_policy_host_os},
+ {prefix = sbox_user_home_dir.."/bin", exec_policy = exec_policy_host_os},
-- Other places under the home directory are expected
-- to contain target binaries:
- {prefix = home_dir, exec_policy = exec_policy_target},
+ {prefix = sbox_user_home_dir, exec_policy = exec_policy_target},
-- Target binaries:
{prefix = target_root, exec_policy = exec_policy_target},
diff --git a/lua_scripts/pathmaps/simple/00_default.lua b/lua_scripts/pathmaps/simple/00_default.lua
index c6bb8bb..6a595a5 100644
--- a/lua_scripts/pathmaps/simple/00_default.lua
+++ b/lua_scripts/pathmaps/simple/00_default.lua
@@ -6,11 +6,6 @@ if (not tools) then
tools = "/"
end
-sb2_session_dir = os.getenv("SBOX_SESSION_DIR")
-if (not sb2_session_dir) then
- sb2_session_dir = "/tmp"
-end
-
simple_chain = {
next_chain = nil,
binary = nil,
@@ -32,8 +27,8 @@ simple_chain = {
{prefix = "/home", use_orig_path = true},
{prefix = "/host_usr", map_to = target_root},
- {prefix = sb2_session_dir, use_orig_path = true},
- {prefix = "/tmp", map_to = sb2_session_dir},
+ {prefix = session_dir, use_orig_path = true},
+ {prefix = "/tmp", map_to = session_dir},
{prefix = "/dev", use_orig_path = true},
{prefix = "/proc", use_orig_path = true},
@@ -48,14 +43,14 @@ simple_chain = {
qemu_chain = {
next_chain = nil,
- binary = basename(os.getenv("SBOX_CPUTRANSPARENCY_METHOD")),
+ binary = basename(sbox_cputransparency_method),
rules = {
{prefix = "/lib", map_to = target_root},
{prefix = "/usr/lib", map_to = target_root},
{prefix = "/usr/local/lib", map_to = target_root},
- {prefix = sb2_session_dir, use_orig_path = true},
- {prefix = "/tmp", map_to = sb2_session_dir},
+ {prefix = session_dir, use_orig_path = true},
+ {prefix = "/tmp", map_to = session_dir},
{prefix = "/dev", use_orig_path = true},
{prefix = "/proc", use_orig_path = true},