From e9215f139be7afa3af116a2039594362e4f1f2be Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 28 Aug 2019 14:45:40 -0300 Subject: Ensure that LuaRocks always finds itself --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 22f1e918..cd9e5a8f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -69,7 +69,7 @@ $(builddir)/luarocks: src/bin/luarocks config.unix 'package.loaded["luarocks.core.hardcoded"] = { '\ "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\ 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ - 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \ + 'local list = package.searchers or package.loaders; table.insert(list, 1, function(name) if name:match("^luarocks%%.") then return loadfile([[$(luadir)/]] .. name:gsub([[%%.]], [[/]]) .. [[.lua]]) end end)\n'; \ tail -n +2 src/bin/luarocks \ )> "$@" @@ -79,7 +79,7 @@ $(builddir)/luarocks-admin: src/bin/luarocks-admin config.unix 'package.loaded["luarocks.core.hardcoded"] = { '\ "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\ 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ - 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \ + 'local list = package.searchers or package.loaders; table.insert(list, 1, function(name) if name:match("^luarocks%%.") then return loadfile([[$(luadir)/]] .. name:gsub([[%%.]], [[/]]) .. [[.lua]]) end end)\n'; \ tail -n +2 src/bin/luarocks-admin \ )> "$@" -- cgit v1.2.3-55-g6feb