aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2017-10-04 11:14:42 -0300
committerGitHub <noreply@github.com>2017-10-04 11:14:42 -0300
commit84b4fe99cac37850a97858e0b641043bd3178d8a (patch)
treeb4578689091b8360aed71f531faf2513b7d41684 /src
parent100c18d048936b5a47f29f55e6ce8b24277fb70f (diff)
downloadluarocks-84b4fe99cac37850a97858e0b641043bd3178d8a.tar.gz
luarocks-84b4fe99cac37850a97858e0b641043bd3178d8a.tar.bz2
luarocks-84b4fe99cac37850a97858e0b641043bd3178d8a.zip
Use versioned files only. (#734)
Let's take the opportunity of a new major version to make an important cleanup: getting rid of the error-prone unversioned configuration files. This drops support for: * Unversioned config.lua -> use config-5.x.lua * Unversioned luarocks/site_config.lua -> it always generates luarocks/core/site_config_5_x.lua * Unversioned lib/luarocks/rocks -> it always uses lib/luarocks/rocks-5.x
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/core/cfg.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
index 8c005aaa..f22acbb4 100644
--- a/src/luarocks/core/cfg.lua
+++ b/src/luarocks/core/cfg.lua
@@ -19,12 +19,9 @@ cfg.lua_version = _VERSION:match(" (5%.[123])$") or "5.1"
19local version_suffix = cfg.lua_version:gsub("%.", "_") 19local version_suffix = cfg.lua_version:gsub("%.", "_")
20 20
21-- Load site-local global configurations 21-- Load site-local global configurations
22local ok, site_config = pcall(require, "luarocks.site_config_"..version_suffix) 22local ok, site_config = pcall(require, "luarocks.core.site_config_"..version_suffix)
23if not ok then 23if not ok then
24 ok, site_config = pcall(require, "luarocks.site_config") 24 io.stderr:write("Site-local luarocks/core/site_config_"..version_suffix..".lua file not found. Incomplete installation?\n")
25end
26if not ok then
27 io.stderr:write("Site-local luarocks/site_config.lua file not found. Incomplete installation?\n")
28 site_config = {} 25 site_config = {}
29end 26end
30 27
@@ -229,7 +226,6 @@ do
229 sys_config_file_default = sys_config_dir.."/config-"..cfg.lua_version..".lua" 226 sys_config_file_default = sys_config_dir.."/config-"..cfg.lua_version..".lua"
230 sys_config_file = load_config_file({ 227 sys_config_file = load_config_file({
231 site_config.LUAROCKS_SYSCONFIG or sys_config_file_default, 228 site_config.LUAROCKS_SYSCONFIG or sys_config_file_default,
232 sys_config_dir.."/config.lua",
233 }) 229 })
234 sys_config_ok = (sys_config_file ~= nil) 230 sys_config_ok = (sys_config_file ~= nil)
235end 231end
@@ -260,7 +256,6 @@ if not site_config.LUAROCKS_FORCE_CONFIG then
260 if not home_config_ok then 256 if not home_config_ok then
261 local list = { 257 local list = {
262 home_config_file_default, 258 home_config_file_default,
263 home_config_dir.."/config.lua",
264 } 259 }
265 home_config_file = load_config_file(list) 260 home_config_file = load_config_file(list)
266 home_config_ok = (home_config_file ~= nil) 261 home_config_ok = (home_config_file ~= nil)
@@ -337,7 +332,7 @@ local defaults = {
337 332
338 lua_modules_path = "/share/lua/"..cfg.lua_version, 333 lua_modules_path = "/share/lua/"..cfg.lua_version,
339 lib_modules_path = "/lib/lua/"..cfg.lua_version, 334 lib_modules_path = "/lib/lua/"..cfg.lua_version,
340 rocks_subdir = site_config.LUAROCKS_ROCKS_SUBDIR or "/lib/luarocks/rocks", 335 rocks_subdir = "/lib/luarocks/rocks-"..cfg.lua_version,
341 336
342 arch = "unknown", 337 arch = "unknown",
343 lib_extension = "unknown", 338 lib_extension = "unknown",