diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2013-10-28 13:27:28 -0700 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-10-28 13:27:28 -0700 |
commit | c815ed22917c19a04b05dc0dedd9127aa4e18a43 (patch) | |
tree | 0da451baca0038869ea3fcc0408c038584f62de4 | |
parent | 54fd9122644d8cc2b302cc7e870155059e595da7 (diff) | |
parent | 5c36bbae187cb5860d9e2188ee90df9cc0e13caa (diff) | |
download | luarocks-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.lua | 8 |
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 | |||
106 | local sys_config_file, home_config_file | 106 | local sys_config_file, home_config_file |
107 | local sys_config_dir, home_config_dir | 107 | local sys_config_dir, home_config_dir |
108 | local sys_config_ok, home_config_ok = false, false | 108 | local sys_config_ok, home_config_ok = false, false |
109 | local extra_luarocks_module_dir | ||
109 | sys_config_dir = site_config.LUAROCKS_SYSCONFDIR | 110 | sys_config_dir = site_config.LUAROCKS_SYSCONFDIR |
110 | if detected.windows then | 111 | if 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 | ||
269 | if detected.windows then | 270 | if 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 = { | |||
477 | setmetatable(_M, cfg_mt) | 479 | setmetatable(_M, cfg_mt) |
478 | 480 | ||
479 | function package_paths() | 481 | function 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") |