diff options
-rw-r--r-- | src/luarocks/cfg.lua | 6 | ||||
-rw-r--r-- | src/luarocks/util.lua | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 476bfbc3..7e4093a6 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -112,6 +112,12 @@ if not site_config.LUAROCKS_FORCE_CONFIG then | |||
112 | local home_overrides = persist.load_into_table(home_config_file, { home = home }) | 112 | local home_overrides = persist.load_into_table(home_config_file, { home = home }) |
113 | if home_overrides then | 113 | if home_overrides then |
114 | local util = require("luarocks.util") | 114 | local util = require("luarocks.util") |
115 | if home_overrides.rocks_trees then | ||
116 | _M.rocks_trees = nil | ||
117 | end | ||
118 | if home_overrides.rocks_servers then | ||
119 | _M.rocks_servers = nil | ||
120 | end | ||
115 | util.deep_merge(_M, home_overrides) | 121 | util.deep_merge(_M, home_overrides) |
116 | end | 122 | end |
117 | end | 123 | end |
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 562953d9..24c2accb 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua | |||
@@ -84,7 +84,11 @@ function deep_merge(dst, src) | |||
84 | if not dst[k] then | 84 | if not dst[k] then |
85 | dst[k] = {} | 85 | dst[k] = {} |
86 | end | 86 | end |
87 | deep_merge(dst[k], v) | 87 | if type(dst[k]) == "table" then |
88 | deep_merge(dst[k], v) | ||
89 | else | ||
90 | dst[k] = v | ||
91 | end | ||
88 | else | 92 | else |
89 | dst[k] = v | 93 | dst[k] = v |
90 | end | 94 | end |