Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luarocks: fix usage of local configs #21

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
luarocks: fix usage of local configs
Skipping of load local configuration files will result in problems and
loss of backward compatibility.

Part of tarantool/tt#1003
oleg-jukovec committed Nov 10, 2024
commit 1caf5397f6ddbab4bbed8aa58431f0c81d2df0a1
10 changes: 5 additions & 5 deletions src/luarocks/core/cfg.lua
Original file line number Diff line number Diff line change
@@ -727,14 +727,10 @@ function cfg.init(detected, warning)
exit_ok, exit_err, exit_what = nil, err, "config"
end

if hardcoded.FORCE_HARDCODED then
util.deep_merge(cfg.variables, hardcoded)
end

-- Load user configuration file (if allowed)
local home_config_ok
local project_config_ok
if not hardcoded.FORCE_CONFIG and not hardcoded.FORCE_HARDCODED then
if not hardcoded.FORCE_CONFIG then
local env_var = "LUAROCKS_CONFIG_" .. cfg.lua_version:gsub("%.", "_")
local env_value = os.getenv(env_var)
if not env_value then
@@ -786,6 +782,10 @@ function cfg.init(detected, warning)
end
end

if hardcoded.FORCE_HARDCODED then
util.deep_merge(cfg.variables, hardcoded)
end

-- backwards compatibility:
if cfg.lua_interpreter and cfg.variables.LUA_BINDIR and not cfg.variables.LUA then
cfg.variables.LUA = dir.path(cfg.variables.LUA_BINDIR, cfg.lua_interpreter)