From 3ba48914da3e4483810affd56e28a8161e1f40ee Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Thu, 16 Dec 2021 18:54:50 +0000 Subject: [PATCH] autobuild: fix 'execl: Argument list too long' Make a command to build kolibri.raw a few kB shorter. git-svn-id: svn://kolibrios.org@9427 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/Tupfile.lua | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 1c8b58d2ea..c8acf22089 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -942,13 +942,10 @@ for i,v in ipairs(raw_files) do raw_file = v[1] local_file = v[2] - if raw_file ~= "/" then - slash_pos = 0 - while true do - slash_pos = string.find(raw_file, '/', slash_pos + 1) - if not slash_pos then break end - table.insert(raw_dirs, string.sub(raw_file, 1, slash_pos - 1)) - end + cur_dir = "" + for dir in string.gmatch(raw_file, "([^/]+)/") do + cur_dir = cur_dir .. "/" .. string.upper(dir) + raw_dirs[cur_dir] = true end -- tup does not want to see hidden files as dependencies @@ -957,17 +954,16 @@ for i,v in ipairs(raw_files) do end end --- img_files and extra_files have some common dirs with different case -for i,d in ipairs(raw_dirs) do - raw_dirs[i] = string.upper(raw_dirs[i]) -end +-- Sorting is needed to mkdir /one before /one/two +raw_dirs_sorted = {} +for k in pairs(raw_dirs) do table.insert(raw_dirs_sorted, k) end +table.sort(raw_dirs_sorted) +raw_dirs = raw_dirs_sorted -- make folders table.sort(raw_dirs) -for i,v in ipairs(raw_dirs) do - if v ~= raw_dirs[i-1] then - make_raw_command = make_raw_command .. ' && mmd -i kolibri.raw@@1M "::' .. v .. '"' - end +for _, dir in pairs(raw_dirs) do + make_raw_command = make_raw_command .. ' && mmd -i kolibri.raw@@1M "::' .. dir .. '"' end -- copy files