-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-all-in-one.sh-with-fallback
executable file
·66 lines (55 loc) · 1.69 KB
/
make-all-in-one.sh-with-fallback
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
cd -- "$(dirname "$0")" || exit 1
# see https://github.com/tst2005/lua-aio
# wget https://raw.githubusercontent.com/tst2005/lua-aio/aio.lua
export LUA_PATH="./?.lua;./?/init.lua;"\
"./src/?.lua;./src/?/init.lua;"\
"../lua-?/?.lua;../lua-?/?/init.lua;"\
"../lua-?/lua/?.lua;../lua-?/lua/?/init.lua;"\
"../lua-?/?.lua;thirdparty/git/tst2005/lua-?/?.lua;;"
[ -d allinone ] || mkdir allinone
luajit -e '
local aio = require "aio.init"
aio.mode("raw2")
local f = function()
aio.mod("bootstrap.fallback", "fallback.lua")
aio.finish()
aio.luacode[[
--- debug ---
local fallback = require "bootstrap.fallback"
--local fallback = fback.require "fallback"
local _require = fallback.require -- or directly fallback
local _PACKAGE = fallback.package
local preload = _PACKAGE.preload
preload["fallback.compat_env"] = function()
return {_NAME="compat_env"}
end
preload["foo.bar"] = function()
return {_NAME="foo.bar"}
end
--- debug end ---
]]
aio.finish()
end
aio.rock.auto("rockspecs/aio-0.6.2-0.rockspec.draft", "aio", f)
' > allinone/aio-with-fallback.lua
if false; then
lua -e '
local aio = require "aio.init"
aio.mode("raw2")
--aio.rock.auto("rockspecs/aio-0.6.0-0.rockspec.draft", "aio")
aio.mod("aio.config", "src/aio/config.lua")
aio.mod("aio.core", "src/aio/core.lua")
aio.mod("aio.mods", "src/aio/modlua.lua")
aio.mod("aio.modlua", "src/aio/modlua.lua")
aio.mod("aio.modraw", "src/aio/modraw.lua")
aio.mod("aio.modraw2", "src/aio/modraw2.lua")
aio.mod("aio.rock", "src/aio/rock.lua")
aio.mod("aio.integrity", "src/aio/integrity.lua")
aio.finish()
aio.mod("compat_env", "compat_env.lua")
aio.finish()
aio.code( "src/aio/init.lua")
aio.finish()
' > aio-wdeps/aio.lua
fi