diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-09-02 11:57:02 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-09-02 15:06:23 -0300 |
commit | 078e42b295eb2d05cdd4a99a9c76a84a45292cb3 (patch) | |
tree | b534959aac7217702530df50560f8c407f4336ed /GNUmakefile | |
parent | 0e034d75c6a480e1ff2545e9c0d78dff580d7763 (diff) | |
download | luarocks-078e42b295eb2d05cdd4a99a9c76a84a45292cb3.tar.gz luarocks-078e42b295eb2d05cdd4a99a9c76a84a45292cb3.tar.bz2 luarocks-078e42b295eb2d05cdd4a99a9c76a84a45292cb3.zip |
Ensure scripts add the prefix to the package path
This reverts the removal from e9215f139be7afa3af116a2039594362e4f1f2be
but keeps the addition of the custom package loader as that is
a more robust approach.
I'm not a super fan of this approach because in a cross-compiling
scenario it does leak the host package.path into the output of commands
such as `luarocks path` and building the `bin` wrappers, but at least
it is less broken than the 3.2.0 behavior, as reported by @fperrad in
issue #1070.
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile index cd9e5a8f..251ab00d 100644 --- a/GNUmakefile +++ b/GNUmakefile | |||
@@ -69,6 +69,7 @@ $(builddir)/luarocks: src/bin/luarocks config.unix | |||
69 | 'package.loaded["luarocks.core.hardcoded"] = { '\ | 69 | 'package.loaded["luarocks.core.hardcoded"] = { '\ |
70 | "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\ | 70 | "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\ |
71 | 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ | 71 | 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ |
72 | 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \ | ||
72 | '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'; \ | 73 | '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'; \ |
73 | tail -n +2 src/bin/luarocks \ | 74 | tail -n +2 src/bin/luarocks \ |
74 | )> "$@" | 75 | )> "$@" |
@@ -79,6 +80,7 @@ $(builddir)/luarocks-admin: src/bin/luarocks-admin config.unix | |||
79 | 'package.loaded["luarocks.core.hardcoded"] = { '\ | 80 | 'package.loaded["luarocks.core.hardcoded"] = { '\ |
80 | "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\ | 81 | "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\ |
81 | 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ | 82 | 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ |
83 | 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \ | ||
82 | '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'; \ | 84 | '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'; \ |
83 | tail -n +2 src/bin/luarocks-admin \ | 85 | tail -n +2 src/bin/luarocks-admin \ |
84 | )> "$@" | 86 | )> "$@" |