diff options
Diffstat (limited to 'Master/texmf-dist/scripts/luaotfload/mkstatus')
-rwxr-xr-x | Master/texmf-dist/scripts/luaotfload/mkstatus | 174 |
1 files changed, 142 insertions, 32 deletions
diff --git a/Master/texmf-dist/scripts/luaotfload/mkstatus b/Master/texmf-dist/scripts/luaotfload/mkstatus index 802b2cd4555..f27d57118cb 100755 --- a/Master/texmf-dist/scripts/luaotfload/mkstatus +++ b/Master/texmf-dist/scripts/luaotfload/mkstatus @@ -26,6 +26,7 @@ local iosavedata = io.savedata local iopopen = io.popen local iowrite = io.write local lfsisdir = lfs.isdir +local stringmatch = string.match ----------------------------------------------------------------------- -- settings @@ -34,35 +35,95 @@ local lfsisdir = lfs.isdir local verbose = false local filelist = "./build/luaotfload-status.lua" --- result +local srcdir = "src" +local builddir = "build" +local scriptdir = "scripts" +local loaderdir = "src/fontloader" +local rtdir = "src/fontloader/runtime" +local miscdir = "src/fontloader/misc" + local names = { - --- only the runtime files and scripts - { "src", "luaotfload-auxiliary.lua", }, - { "src", "luaotfload-basics-gen.lua", }, - { "src", "luaotfload-basics-nod.lua", }, - { "build", "luaotfload-characters.lua", }, - { "src", "luaotfload-colors.lua", }, - { "src", "luaotfload-database.lua", }, - { "src", "luaotfload-diagnostics.lua", }, - { "src", "luaotfload-features.lua", }, - { "src", "luaotfload-fonts-cbk.lua", }, - { "src", "luaotfload-fonts-def.lua", }, - { "src", "luaotfload-fonts-enc.lua", }, - { "src", "luaotfload-fonts-ext.lua", }, - { "src", "luaotfload-fonts-lua.lua", }, - { "src", "luaotfload-fonts-tfm.lua", }, - { "build", "luaotfload-glyphlist.lua", }, - { "src", "luaotfload-letterspace.lua", }, - { "src", "luaotfload-loaders.lua", }, - { "src", "luaotfload-log.lua", }, - { "src", "luaotfload-main.lua", }, - { "src", "luaotfload-fontloader.lua", }, - { "src", "luaotfload-override.lua", }, - { "src", "luaotfload-parsers.lua", }, - { "src", "luaotfload-tool.lua", }, - { "scripts", "mkcharacters", }, - { "scripts", "mkglyphlist", }, - { "scripts", "mkstatus", }, -} + + --- Luaotfload runtime files + { srcdir, "luaotfload-auxiliary.lua", }, + { srcdir, "luaotfload-colors.lua", }, + { srcdir, "luaotfload-configuration.lua", }, + { srcdir, "luaotfload-database.lua", }, + { srcdir, "luaotfload-diagnostics.lua", }, + { srcdir, "luaotfload-features.lua", }, + { srcdir, "luaotfload-init.lua", }, + { srcdir, "luaotfload-letterspace.lua", }, + { srcdir, "luaotfload-loaders.lua", }, + { srcdir, "luaotfload-log.lua", }, + { srcdir, "luaotfload-main.lua", }, + { srcdir, "luaotfload-parsers.lua", }, + { srcdir, "luaotfload-resolvers.lua", }, + { srcdir, "luaotfload-tool.lua", }, + + --- generated files + { builddir, "luaotfload-characters.lua", }, + { builddir, "luaotfload-glyphlist.lua", }, + + --- scripts + { scriptdir, "mkcharacters", }, + { scriptdir, "mkglyphlist", }, + { scriptdir, "mkimport", }, + { scriptdir, "mkstatus", }, + { scriptdir, "mktests", }, + + --- merge script + { loaderdir, "luaotfload-package.lua", }, + + --- fontloader runtimes + { rtdir, "fontloader-basics-gen.lua", }, + { rtdir, "fontloader-reference.lua", }, + { rtdir, "fontloader-tl2014.lua", }, + + --- fontloader constituents + { miscdir, "fontloader-basics-nod.lua", }, + { miscdir, "fontloader-data-con.lua", }, + { miscdir, "fontloader-font-afk.lua", }, + { miscdir, "fontloader-font-afm.lua", }, + { miscdir, "fontloader-font-cid.lua", }, + { miscdir, "fontloader-font-con.lua", }, + { miscdir, "fontloader-font-def.lua", }, + { miscdir, "fontloader-font-ini.lua", }, + { miscdir, "fontloader-font-map.lua", }, + { miscdir, "fontloader-font-otb.lua", }, + { miscdir, "fontloader-font-otf.lua", }, + { miscdir, "fontloader-font-oti.lua", }, + { miscdir, "fontloader-font-otp.lua", }, + { miscdir, "fontloader-fonts-cbk.lua", }, + { miscdir, "fontloader-fonts-def.lua", }, + { miscdir, "fontloader-fonts-demo-vf-1.lua", }, + { miscdir, "fontloader-fonts-enc.lua", }, + { miscdir, "fontloader-fonts-ext.lua", }, + { miscdir, "fontloader-fonts-inj.lua", }, + { miscdir, "fontloader-fonts.lua", }, + { miscdir, "fontloader-fonts-lua.lua", }, + { miscdir, "fontloader-fonts-ota.lua", }, + { miscdir, "fontloader-fonts-otn.lua", }, + { miscdir, "fontloader-fonts-syn.lua", }, + { miscdir, "fontloader-fonts-tfm.lua", }, + { miscdir, "fontloader-font-tfm.lua", }, + { miscdir, "fontloader-languages.lua", }, + { miscdir, "fontloader-l-boolean.lua", }, + { miscdir, "fontloader-l-file.lua", }, + { miscdir, "fontloader-l-function.lua", }, + { miscdir, "fontloader-l-io.lua", }, + { miscdir, "fontloader-l-lpeg.lua", }, + { miscdir, "fontloader-l-lua.lua", }, + { miscdir, "fontloader-l-math.lua", }, + { miscdir, "fontloader-l-string.lua", }, + { miscdir, "fontloader-l-table.lua", }, + { miscdir, "fontloader-math.lua", }, + { miscdir, "fontloader-mplib.lua", }, + { miscdir, "fontloader-preprocessor.lua", }, + { miscdir, "fontloader-swiglib.lua", }, + { miscdir, "fontloader-swiglib-test.lua", }, + { miscdir, "fontloader-util-str.lua", }, + +} --[[local names]] ----------------------------------------------------------------------- -- helpers @@ -121,8 +182,9 @@ end local hash_all hash_all = function (list, acc) - if list == nil then - return hash_all (table.fastcopy (names), { }) + if acc == nil then + local base = table.fastcopy (names) + return hash_all (table.append (base, list), { }) end local finfo = list[#list] @@ -156,10 +218,58 @@ hash_all = function (list, acc) return acc end +local handle_argv = function (argv) + local ret = { files = { }, loader = nil } + local argc = #argv + if argc < 1 then return ret end + local argoff = 1 + if argv [1] == "-v" then + verbose = true + if argc == 1 then return ret end + argoff = 2 + end + local aux aux = function (acc, i) + if i > argc then return acc else + local cur = argv[i] + if type (cur) == "string" then + local loader = stringmatch (cur, "--fontloader=(.+)$") + if loader then + cur = loader + acc.loader = file.basename (cur) + end + if lfs.isfile (cur) then + local files = acc.files + files[#files + 1] = cur + end + else + die ("file not found: %s", tostring (cur)) + end + return aux (acc, i + 1) + end + end + return aux (ret, argoff) +end + +local add_files +add_files = function (lst, acc) + if lst == nil then return end + if acc == nil then return add_files (lst, { }) end + local len = #lst + if len == 0 then return acc end + local cur = lst[len] + local fname = file.basename (cur) + local path = file.dirname (cur) + acc[#acc + 1] = { path, fname } + lst[len] = nil + return add_files (lst, acc) +end + local main = function () - if arg [1] == "-v" then verbose = true end - local hashes = hash_all () + local raw_extra = handle_argv (arg) + local cuit_extra = add_files (raw_extra.files) + local hashes = hash_all (cuit_extra) local notes = git_info () + notes.loader = raw_extra.loader local serialized = table.serialize ({ notes = notes, hashes = hashes }, true) local success = io.savedata (filelist, serialized) |