diff options
Diffstat (limited to 'src/luarocks/cfg.lua')
-rw-r--r-- | src/luarocks/cfg.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index ddcfac9d..bd3bdbc3 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | local rawset, next, table, pairs, print, require, io, os, setmetatable, pcall = | 2 | local rawset, next, table, pairs, print, require, io, os, setmetatable, pcall, ipairs, package = |
3 | rawset, next, table, pairs, print, require, io, os, setmetatable, pcall | 3 | rawset, next, table, pairs, print, require, io, os, setmetatable, pcall, ipairs, package |
4 | 4 | ||
5 | --- Configuration for LuaRocks. | 5 | --- Configuration for LuaRocks. |
6 | -- Tries to load the user's configuration file and | 6 | -- Tries to load the user's configuration file and |
@@ -109,6 +109,8 @@ local defaults = { | |||
109 | root_dir = root, | 109 | root_dir = root, |
110 | rocks_dir = root.."/lib/luarocks/rocks", | 110 | rocks_dir = root.."/lib/luarocks/rocks", |
111 | scripts_dir = root.."/bin/", | 111 | scripts_dir = root.."/bin/", |
112 | lua_modules_path = "/share/lua/5.1/", | ||
113 | bin_modules_path = "/lib/lua/5.1/", | ||
112 | lua_modules_dir = root.."/share/lua/5.1/", | 114 | lua_modules_dir = root.."/share/lua/5.1/", |
113 | bin_modules_dir = root.."/lib/lua/5.1/", | 115 | bin_modules_dir = root.."/lib/lua/5.1/", |
114 | 116 | ||
@@ -269,3 +271,10 @@ local cfg_mt = { | |||
269 | end | 271 | end |
270 | } | 272 | } |
271 | setmetatable(_M, cfg_mt) | 273 | setmetatable(_M, cfg_mt) |
274 | |||
275 | |||
276 | for _,tree in ipairs(rocks_trees) do | ||
277 | package.path = tree..lua_modules_path.."/?.lua;"..tree..lua_modules_path.."/?/init.lua;"..package.path | ||
278 | package.cpath = tree..bin_modules_path.."/?."..lib_extension..";"..package.cpath | ||
279 | end | ||
280 | |||