aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-10-28 13:27:28 -0700
committerHisham Muhammad <hisham@gobolinux.org>2013-10-28 13:27:28 -0700
commitc815ed22917c19a04b05dc0dedd9127aa4e18a43 (patch)
tree0da451baca0038869ea3fcc0408c038584f62de4
parent54fd9122644d8cc2b302cc7e870155059e595da7 (diff)
parent5c36bbae187cb5860d9e2188ee90df9cc0e13caa (diff)
downloadluarocks-c815ed22917c19a04b05dc0dedd9127aa4e18a43.tar.gz
luarocks-c815ed22917c19a04b05dc0dedd9127aa4e18a43.tar.bz2
luarocks-c815ed22917c19a04b05dc0dedd9127aa4e18a43.zip
Merge pull request #171 from siffiejoe/lua-path-windows
added extra path for luarocks modules on windows
-rw-r--r--src/luarocks/cfg.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 2da72db0..b8e3a500 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -106,6 +106,7 @@ end
106local sys_config_file, home_config_file 106local sys_config_file, home_config_file
107local sys_config_dir, home_config_dir 107local sys_config_dir, home_config_dir
108local sys_config_ok, home_config_ok = false, false 108local sys_config_ok, home_config_ok = false, false
109local extra_luarocks_module_dir
109sys_config_dir = site_config.LUAROCKS_SYSCONFDIR 110sys_config_dir = site_config.LUAROCKS_SYSCONFDIR
110if detected.windows then 111if detected.windows then
111 home = os.getenv("APPDATA") or "c:" 112 home = os.getenv("APPDATA") or "c:"
@@ -268,6 +269,7 @@ local defaults = {
268 269
269if detected.windows then 270if detected.windows then
270 local full_prefix = site_config.LUAROCKS_PREFIX.."\\"..major_version 271 local full_prefix = site_config.LUAROCKS_PREFIX.."\\"..major_version
272 extra_luarocks_module_dir = full_prefix.."\\lua\\?.lua"
271 273
272 home_config_file = home_config_file and home_config_file:gsub("\\","/") 274 home_config_file = home_config_file and home_config_file:gsub("\\","/")
273 defaults.fs_use_modules = false 275 defaults.fs_use_modules = false
@@ -293,8 +295,8 @@ if detected.windows then
293 defaults.variables.LIBFLAG = "/dll" 295 defaults.variables.LIBFLAG = "/dll"
294 defaults.variables.LUALIB = "lua"..lua_version..".lib" 296 defaults.variables.LUALIB = "lua"..lua_version..".lib"
295 297
296 local bins = { "SEVENZ", "CHMOD", "CP", "FIND", "LS", "MD5SUM", 298 local bins = { "SEVENZ", "CP", "FIND", "LS", "MD5SUM",
297 "MKDIR", "MV", "PWD", "RMDIR", "RM", "TEST", "UNAME", "WGET" } 299 "MKDIR", "MV", "PWD", "RMDIR", "TEST", "UNAME", "WGET" }
298 for _, var in ipairs(bins) do 300 for _, var in ipairs(bins) do
299 if defaults.variables[var] then 301 if defaults.variables[var] then
300 defaults.variables[var] = full_prefix.."\\bin\\"..defaults.variables[var] 302 defaults.variables[var] = full_prefix.."\\bin\\"..defaults.variables[var]
@@ -477,7 +479,7 @@ local cfg_mt = {
477setmetatable(_M, cfg_mt) 479setmetatable(_M, cfg_mt)
478 480
479function package_paths() 481function package_paths()
480 local new_path, new_cpath = {}, {} 482 local new_path, new_cpath = { extra_luarocks_module_dir }, {}
481 for _,tree in ipairs(rocks_trees) do 483 for _,tree in ipairs(rocks_trees) do
482 if type(tree) == "string" then 484 if type(tree) == "string" then
483 table.insert(new_path, 1, tree..lua_modules_path.."/?.lua;"..tree..lua_modules_path.."/?/init.lua") 485 table.insert(new_path, 1, tree..lua_modules_path.."/?.lua;"..tree..lua_modules_path.."/?/init.lua")