From 1219cb353ead5f88b2417b3c7d86a72a4bd42a2c Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 14 Mar 2019 21:21:30 -0300 Subject: Do not register system tree if installing to ~/.luarocks See https://github.com/luarocks/luarocks/issues/952#issuecomment-449966779 --- GNUmakefile | 2 +- src/luarocks/core/cfg.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 60f08dc8..4e814740 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -35,7 +35,7 @@ $(builddir)/config-$(LUA_VERSION).lua: config.unix @printf -- '-- LuaRocks configuration\n\n'\ 'rocks_trees = {\n'\ ' { name = "user", root = home .. "/.luarocks" };\n'\ - ' { name = "system", root = "'"$(rocks_tree)"'" };\n'\ + "$$([ "$(rocks_tree)" != "$(HOME)/.luarocks" ] && printf ' { name = "system", root = "'"$(rocks_tree)"'" };\\n')"\ '}\n'\ "$$([ -n "$(LUA_INTERPRETER)" ] && printf 'lua_interpreter = "%s";\\n' "$(LUA_INTERPRETER)")"\ 'variables = {\n'\ diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 9859c6b3..75075792 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -710,7 +710,7 @@ function cfg.init(lua_data, project_dir, warning) if cfg.home_tree then table.insert(cfg.rocks_trees, { name = "user", root = cfg.home_tree } ) end - if hardcoded.PREFIX then + if hardcoded.PREFIX and hardcoded.PREFIX ~= cfg.home_tree then table.insert(cfg.rocks_trees, { name = "system", root = hardcoded.PREFIX } ) end end -- cgit v1.2.3-55-g6feb