aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cfg.lua12
-rw-r--r--src/luarocks/path_cmd.lua2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 0099ec3a..f01fd205 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -666,17 +666,23 @@ function cfg.make_paths_from_tree(tree)
666 return lua_path, lib_path, bin_path 666 return lua_path, lib_path, bin_path
667end 667end
668 668
669function cfg.package_paths() 669function cfg.package_paths(current)
670 local new_path, new_cpath, new_bin = {}, {}, {} 670 local new_path, new_cpath, new_bin = {}, {}, {}
671 for _,tree in ipairs(cfg.rocks_trees) do 671 local function add_tree_to_paths(tree)
672 local lua_path, lib_path, bin_path = cfg.make_paths_from_tree(tree) 672 local lua_path, lib_path, bin_path = cfg.make_paths_from_tree(tree)
673 table.insert(new_path, lua_path.."/?.lua") 673 table.insert(new_path, lua_path.."/?.lua")
674 table.insert(new_path, lua_path.."/?/init.lua") 674 table.insert(new_path, lua_path.."/?/init.lua")
675 table.insert(new_cpath, lib_path.."/?."..cfg.lib_extension) 675 table.insert(new_cpath, lib_path.."/?."..cfg.lib_extension)
676 table.insert(new_bin, bin_path) 676 table.insert(new_bin, bin_path)
677 end 677 end
678 if current then
679 add_tree_to_paths(current)
680 end
681 for _,tree in ipairs(cfg.rocks_trees) do
682 add_tree_to_paths(tree)
683 end
678 if extra_luarocks_module_dir then 684 if extra_luarocks_module_dir then
679 table.insert(new_path, extra_luarocks_module_dir) 685 table.insert(new_path, extra_luarocks_module_dir)
680 end 686 end
681 return table.concat(new_path, ";"), table.concat(new_cpath, ";"), table.concat(new_bin, cfg.export_path_separator) 687 return table.concat(new_path, ";"), table.concat(new_cpath, ";"), table.concat(new_bin, cfg.export_path_separator)
682end 688end
diff --git a/src/luarocks/path_cmd.lua b/src/luarocks/path_cmd.lua
index 2bee4cb5..ecd6d4b1 100644
--- a/src/luarocks/path_cmd.lua
+++ b/src/luarocks/path_cmd.lua
@@ -37,7 +37,7 @@ function path_cmd.run(...)
37 local flags = util.parse_flags(...) 37 local flags = util.parse_flags(...)
38 local deps_mode = deps.get_deps_mode(flags) 38 local deps_mode = deps.get_deps_mode(flags)
39 39
40 local lr_path, lr_cpath, lr_bin = cfg.package_paths() 40 local lr_path, lr_cpath, lr_bin = cfg.package_paths(flags["tree"])
41 local path_sep = cfg.export_path_separator 41 local path_sep = cfg.export_path_separator
42 42
43 if flags["lr-path"] then 43 if flags["lr-path"] then