diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2015-06-25 00:14:50 +0200 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2015-06-25 00:14:50 +0200 |
| commit | f6974b40735b9300f7b529da6e602459d0db9c49 (patch) | |
| tree | 7e6ddf79fd10256252795d4ffa116e9e1c999281 /src | |
| parent | 6cb37a1c73fd9f8b23565725f835b84e9872cf29 (diff) | |
| download | luarocks-f6974b40735b9300f7b529da6e602459d0db9c49.tar.gz luarocks-f6974b40735b9300f7b529da6e602459d0db9c49.tar.bz2 luarocks-f6974b40735b9300f7b529da6e602459d0db9c49.zip | |
config.lua is not being integrated, bug introduced in #385
Diffstat (limited to 'src')
| -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 2a92c4dd..03fc2ad2 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
| @@ -159,6 +159,16 @@ env_for_config_file = { | |||
| 159 | print(util.show_table(env_for_config_file, "global environment")) | 159 | print(util.show_table(env_for_config_file, "global environment")) |
| 160 | end, | 160 | end, |
| 161 | } | 161 | } |
| 162 | -- Merge values from config files read into the `cfg` table | ||
| 163 | local merge_overrides = function(overrides) | ||
| 164 | if overrides.rocks_trees then | ||
| 165 | cfg.rocks_trees = nil | ||
| 166 | end | ||
| 167 | if overrides.rocks_servers then | ||
| 168 | cfg.rocks_servers = nil | ||
| 169 | end | ||
| 170 | util.deep_merge(cfg, overrides) | ||
| 171 | end | ||
| 162 | 172 | ||
| 163 | sys_config_file = site_config.LUAROCKS_SYSCONFIG or sys_config_dir.."/config-"..cfg.lua_version..".lua" | 173 | sys_config_file = site_config.LUAROCKS_SYSCONFIG or sys_config_dir.."/config-"..cfg.lua_version..".lua" |
| 164 | do | 174 | do |
| @@ -172,6 +182,7 @@ do | |||
| 172 | io.stderr:write(err.."\n") | 182 | io.stderr:write(err.."\n") |
| 173 | os.exit(cfg.errorcodes.CONFIGFILE) | 183 | os.exit(cfg.errorcodes.CONFIGFILE) |
| 174 | end | 184 | end |
| 185 | merge_overrides(sys_config_ok) | ||
| 175 | end | 186 | end |
| 176 | 187 | ||
| 177 | if not site_config.LUAROCKS_FORCE_CONFIG then | 188 | if not site_config.LUAROCKS_FORCE_CONFIG then |
| @@ -190,13 +201,7 @@ if not site_config.LUAROCKS_FORCE_CONFIG then | |||
| 190 | end | 201 | end |
| 191 | if home_overrides then | 202 | if home_overrides then |
| 192 | home_config_ok = true | 203 | home_config_ok = true |
| 193 | if home_overrides.rocks_trees then | 204 | merge_overrides(home_overrides) |
| 194 | cfg.rocks_trees = nil | ||
| 195 | end | ||
| 196 | if home_overrides.rocks_servers then | ||
| 197 | cfg.rocks_servers = nil | ||
| 198 | end | ||
| 199 | util.deep_merge(cfg, home_overrides) | ||
| 200 | else | 205 | else |
| 201 | home_config_ok = home_overrides | 206 | home_config_ok = home_overrides |
| 202 | if errcode ~= "open" then | 207 | if errcode ~= "open" then |
| @@ -220,6 +225,7 @@ end | |||
| 220 | local defaults = { | 225 | local defaults = { |
| 221 | 226 | ||
| 222 | local_by_default = false, | 227 | local_by_default = false, |
| 228 | use_extensions = false, | ||
| 223 | accept_unknown_fields = false, | 229 | accept_unknown_fields = false, |
| 224 | fs_use_modules = true, | 230 | fs_use_modules = true, |
| 225 | hooks_enabled = true, | 231 | hooks_enabled = true, |
