diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-12-01 15:18:17 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-12-01 15:18:17 -0200 |
commit | 941801942cedd832a4c78d1db3d297b23536af22 (patch) | |
tree | 9ddd634e660b9f7e72afa3643b967a5442110c0a /src | |
parent | adec4bf7f83e5d9214c708e816f8041f0da94541 (diff) | |
parent | 334e8b5126864f0d0a5a34ce6953a44ef7eefc51 (diff) | |
download | luarocks-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.lua | 6 | ||||
-rw-r--r-- | src/luarocks/fs/lua.lua | 6 |
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 | |||
149 | local sys_config_dir, home_config_dir | 149 | local sys_config_dir, home_config_dir |
150 | local sys_config_ok, home_config_ok = false, false | 150 | local sys_config_ok, home_config_ok = false, false |
151 | local extra_luarocks_module_dir | 151 | local extra_luarocks_module_dir |
152 | sys_config_dir = site_config.LUAROCKS_SYSCONFDIR | 152 | sys_config_dir = site_config.LUAROCKS_SYSCONFDIR or site_config.LUAROCKS_PREFIX |
153 | if cfg.platforms.windows then | 153 | if 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() | |||
663 | end | 663 | end |
664 | 664 | ||
665 | function cfg.which_config() | 665 | function 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 | ||
676 | end | 678 | end |
677 | 679 | ||
678 | cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch | 680 | cfg.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 |