diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-03-14 21:21:30 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-03-14 23:19:39 -0300 |
commit | 1219cb353ead5f88b2417b3c7d86a72a4bd42a2c (patch) | |
tree | f2876e0866e93723bb3b528ad7357aabad9f72db | |
parent | 3855e599dd9f7da7d1f1956d7523279146f9bd76 (diff) | |
download | luarocks-1219cb353ead5f88b2417b3c7d86a72a4bd42a2c.tar.gz luarocks-1219cb353ead5f88b2417b3c7d86a72a4bd42a2c.tar.bz2 luarocks-1219cb353ead5f88b2417b3c7d86a72a4bd42a2c.zip |
Do not register system tree if installing to ~/.luarocks
See https://github.com/luarocks/luarocks/issues/952#issuecomment-449966779
-rw-r--r-- | GNUmakefile | 2 | ||||
-rw-r--r-- | 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 | |||
35 | @printf -- '-- LuaRocks configuration\n\n'\ | 35 | @printf -- '-- LuaRocks configuration\n\n'\ |
36 | 'rocks_trees = {\n'\ | 36 | 'rocks_trees = {\n'\ |
37 | ' { name = "user", root = home .. "/.luarocks" };\n'\ | 37 | ' { name = "user", root = home .. "/.luarocks" };\n'\ |
38 | ' { name = "system", root = "'"$(rocks_tree)"'" };\n'\ | 38 | "$$([ "$(rocks_tree)" != "$(HOME)/.luarocks" ] && printf ' { name = "system", root = "'"$(rocks_tree)"'" };\\n')"\ |
39 | '}\n'\ | 39 | '}\n'\ |
40 | "$$([ -n "$(LUA_INTERPRETER)" ] && printf 'lua_interpreter = "%s";\\n' "$(LUA_INTERPRETER)")"\ | 40 | "$$([ -n "$(LUA_INTERPRETER)" ] && printf 'lua_interpreter = "%s";\\n' "$(LUA_INTERPRETER)")"\ |
41 | 'variables = {\n'\ | 41 | '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) | |||
710 | if cfg.home_tree then | 710 | if cfg.home_tree then |
711 | table.insert(cfg.rocks_trees, { name = "user", root = cfg.home_tree } ) | 711 | table.insert(cfg.rocks_trees, { name = "user", root = cfg.home_tree } ) |
712 | end | 712 | end |
713 | if hardcoded.PREFIX then | 713 | if hardcoded.PREFIX and hardcoded.PREFIX ~= cfg.home_tree then |
714 | table.insert(cfg.rocks_trees, { name = "system", root = hardcoded.PREFIX } ) | 714 | table.insert(cfg.rocks_trees, { name = "system", root = hardcoded.PREFIX } ) |
715 | end | 715 | end |
716 | end | 716 | end |