diff options
Diffstat (limited to 'src/luarocks/cfg.lua')
-rw-r--r-- | src/luarocks/cfg.lua | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 1207d600..97b6a09e 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -523,18 +523,24 @@ local cfg_mt = { | |||
523 | setmetatable(cfg, cfg_mt) | 523 | setmetatable(cfg, cfg_mt) |
524 | 524 | ||
525 | function cfg.package_paths() | 525 | function cfg.package_paths() |
526 | local new_path, new_cpath = { extra_luarocks_module_dir }, {} | 526 | local new_path, new_cpath, new_bin = {}, {}, {} |
527 | for _,tree in ipairs(cfg.rocks_trees) do | 527 | for _,tree in ipairs(cfg.rocks_trees) do |
528 | if type(tree) == "string" then | 528 | if type(tree) == "string" then |
529 | table.insert(new_path, 1, tree..cfg.lua_modules_path.."/?.lua;"..tree..cfg.lua_modules_path.."/?/init.lua") | 529 | table.insert(new_path, tree..cfg.lua_modules_path.."/?.lua") |
530 | table.insert(new_cpath, 1, tree..cfg.lib_modules_path.."/?."..cfg.lib_extension) | 530 | table.insert(new_path, tree..cfg.lua_modules_path.."/?/init.lua") |
531 | table.insert(new_cpath, tree..cfg.lib_modules_path.."/?."..cfg.lib_extension) | ||
532 | table.insert(new_bin, tree.."/bin") | ||
531 | else | 533 | else |
532 | table.insert(new_path, 1, (tree.lua_dir or tree.root..cfg.lua_modules_path).."/?.lua;".. | 534 | table.insert(new_path, (tree.lua_dir or tree.root..cfg.lua_modules_path).."/?.lua") |
533 | (tree.lua_dir or tree.root..cfg.lua_modules_path).."/?/init.lua") | 535 | table.insert(new_path, (tree.lua_dir or tree.root..cfg.lua_modules_path).."/?/init.lua") |
534 | table.insert(new_cpath, 1, (tree.lib_dir or tree.root..cfg.lib_modules_path).."/?."..cfg.lib_extension) | 536 | table.insert(new_cpath, (tree.lib_dir or tree.root..cfg.lib_modules_path).."/?."..cfg.lib_extension) |
537 | table.insert(new_bin, (tree.bin_dir or tree.root.."/bin")) | ||
535 | end | 538 | end |
536 | end | 539 | end |
537 | return table.concat(new_path, ";"), table.concat(new_cpath, ";") | 540 | if extra_luarocks_module_dir then |
541 | table.insert(new_path, extra_luarocks_module_dir) | ||
542 | end | ||
543 | return table.concat(new_path, ";"), table.concat(new_cpath, ";"), table.concat(new_bin, ";") | ||
538 | end | 544 | end |
539 | 545 | ||
540 | function cfg.which_config() | 546 | function cfg.which_config() |