From ef724a68449938f6ab9ccf58bdcf8234bac87b06 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 27 Feb 2024 14:49:58 -0300 Subject: binary: encode dependency order (luasec depends on luasocket) --- binary/all_in_one | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/binary/all_in_one b/binary/all_in_one index 784ce1ec..9b675eba 100755 --- a/binary/all_in_one +++ b/binary/all_in_one @@ -463,24 +463,36 @@ local function main() local dependencies = { md5 = "md5", + luasocket = "./binary/luasocket-3.1.0-1.rockspec", luasec = "./binary/luasec-1.3.2-1.rockspec", ["lua-zlib"] = "./binary/lua-zlib-1.2-0.rockspec", ["lua-bz2"] = "./binary/lua-bz2-0.2.1-1.rockspec", luaposix = if_platform("unix", "./binary/luaposix-35.1-1.rockspec"), - luasocket = "./binary/luasocket-3.1.0-1.rockspec", luafilesystem = "luafilesystem", } + local dependency_order = { + "md5", + "luasocket", "luasec", + "lua-zlib", + "lua-bz2", + "luaposix", + "luafilesystem", + } + fs.make_dir(LUA_MODULES) - for name, arg in pairs(dependencies) do - print("----------------------------------------------------------------") - print(name) - print("----------------------------------------------------------------") - local vers = manif.get_versions(queries.from_dep_string(name), "one") - if not next(vers) then - local ok = os.execute("LUAROCKS_CONFIG='" .. CONFIG_FILE .. "' ./luarocks install --no-project '--tree=" .. LUA_MODULES .. "' " .. arg) - if ok ~= 0 and ok ~= true then - error("Failed building dependency: " .. name) + for _, name in ipairs(dependency_order) do + local use = dependencies[name] + if use then + print("----------------------------------------------------------------") + print(name) + print("----------------------------------------------------------------") + local vers = manif.get_versions(queries.from_dep_string(name), "one") + if not next(vers) then + local ok = os.execute("LUAROCKS_CONFIG='" .. CONFIG_FILE .. "' ./luarocks install --no-project '--tree=" .. LUA_MODULES .. "' " .. use) + if ok ~= 0 and ok ~= true then + error("Failed building dependency: " .. name) + end end end end -- cgit v1.2.3-55-g6feb