aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-12-01 15:18:17 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-12-01 15:18:17 -0200
commit941801942cedd832a4c78d1db3d297b23536af22 (patch)
tree9ddd634e660b9f7e72afa3643b967a5442110c0a /src
parentadec4bf7f83e5d9214c708e816f8041f0da94541 (diff)
parent334e8b5126864f0d0a5a34ce6953a44ef7eefc51 (diff)
downloadluarocks-941801942cedd832a4c78d1db3d297b23536af22.tar.gz
luarocks-941801942cedd832a4c78d1db3d297b23536af22.tar.bz2
luarocks-941801942cedd832a4c78d1db3d297b23536af22.zip
Merge branch 'master' of https://github.com/keplerproject/luarocks
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cfg.lua6
-rw-r--r--src/luarocks/fs/lua.lua6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index e3d6e74b..e41b632c 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -149,7 +149,7 @@ local sys_config_file_default, home_config_file_default
149local sys_config_dir, home_config_dir 149local sys_config_dir, home_config_dir
150local sys_config_ok, home_config_ok = false, false 150local sys_config_ok, home_config_ok = false, false
151local extra_luarocks_module_dir 151local extra_luarocks_module_dir
152sys_config_dir = site_config.LUAROCKS_SYSCONFDIR 152sys_config_dir = site_config.LUAROCKS_SYSCONFDIR or site_config.LUAROCKS_PREFIX
153if cfg.platforms.windows then 153if cfg.platforms.windows then
154 cfg.home = os.getenv("APPDATA") or "c:" 154 cfg.home = os.getenv("APPDATA") or "c:"
155 sys_config_dir = sys_config_dir or "c:/luarocks" 155 sys_config_dir = sys_config_dir or "c:/luarocks"
@@ -663,7 +663,7 @@ function cfg.init_package_paths()
663end 663end
664 664
665function cfg.which_config() 665function cfg.which_config()
666 return { 666 local ret = {
667 system = { 667 system = {
668 file = sys_config_file or sys_config_file_default, 668 file = sys_config_file or sys_config_file_default,
669 ok = sys_config_ok, 669 ok = sys_config_ok,
@@ -673,6 +673,8 @@ function cfg.which_config()
673 ok = home_config_ok, 673 ok = home_config_ok,
674 } 674 }
675 } 675 }
676 ret.nearest = (ret.user.ok and ret.user.file) or ret.system.file
677 return ret
676end 678end
677 679
678cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch 680cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index 73ae2698..18e6b01a 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -134,10 +134,10 @@ function fs_lua.is_tool_available(tool_cmd, tool_name, arg)
134 arg = arg or "--version" 134 arg = arg or "--version"
135 assert(type(arg) == "string") 135 assert(type(arg) == "string")
136 136
137 if not fs.execute_quiet(tool_cmd, arg) then 137 if not fs.execute_quiet(fs.Q(tool_cmd), arg) then
138 local msg = "'%s' program not found. Make sure %s is installed and is available in your PATH " .. 138 local msg = "'%s' program not found. Make sure %s is installed and is available in your PATH " ..
139 "(or you may want to edit the 'variables.%s' value in file 'config.lua')" 139 "(or you may want to edit the 'variables.%s' value in file '%s')"
140 return nil, msg:format(tool_cmd, tool_name, tool_cmd:upper()) 140 return nil, msg:format(tool_cmd, tool_name, tool_name:upper(), cfg.which_config().nearest)
141 else 141 else
142 return true 142 return true
143 end 143 end