From 5b34e978a75f89b0be8c5828696bd5f39c028806 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 17 Jul 2015 07:57:38 +0200 Subject: [status, doc] remove references to override script --- scripts/mkstatus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/mkstatus') diff --git a/scripts/mkstatus b/scripts/mkstatus index e18abb7..ba9cb06 100755 --- a/scripts/mkstatus +++ b/scripts/mkstatus @@ -56,7 +56,7 @@ local names = { { "src", "luaotfload-log.lua", }, { "src", "luaotfload-main.lua", }, { "src/fontloader/runtime", "fontloader-fontloader.lua", }, - { "src", "luaotfload-override.lua", }, + --{ "src", "luaotfload-override.lua", }, --> part of init now { "src", "luaotfload-parsers.lua", }, { "src", "luaotfload-tool.lua", }, { "scripts", "mkcharacters", }, -- cgit v1.2.3 From c4ed163680db9a566b29f5f1d8b98a928f8055a0 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 21 Jul 2015 07:39:52 +0200 Subject: [status] allow passing additional files on command line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During a build process, the name of a freshly created fontloader package will be passed to ``mkstatus`` so it’ll be considered in the status file. --- scripts/mkstatus | 49 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) (limited to 'scripts/mkstatus') diff --git a/scripts/mkstatus b/scripts/mkstatus index ba9cb06..9e10c03 100755 --- a/scripts/mkstatus +++ b/scripts/mkstatus @@ -55,7 +55,7 @@ local names = { { "src", "luaotfload-loaders.lua", }, { "src", "luaotfload-log.lua", }, { "src", "luaotfload-main.lua", }, - { "src/fontloader/runtime", "fontloader-fontloader.lua", }, + { "src/fontloader/runtime", "fontloader-reference.lua", }, --{ "src", "luaotfload-override.lua", }, --> part of init now { "src", "luaotfload-parsers.lua", }, { "src", "luaotfload-tool.lua", }, @@ -121,8 +121,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,9 +157,47 @@ hash_all = function (list, acc) return acc end +local handle_argv = function (argv) + local argc = #argv + if argc < 1 then return { } end + local argoff = 1 + if argv [1] == "-v" then + verbose = true + if argc == 1 then return { } 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" and lfs.isfile (cur) then + acc[#acc + 1] = cur + else + die ("file not found: %s", tostring (cur)) + end + return aux (acc, i + 1) + end + end + return aux ({ }, 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) + local hashes = hash_all (cuit_extra) local notes = git_info () local serialized = table.serialize ({ notes = notes, hashes = hashes }, true) -- cgit v1.2.3 From 6eff203e9bf3348d090b6b5046466415bcd6530a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 21 Jul 2015 08:11:21 +0200 Subject: [mkstatus,build,conf] default to packaged fontloader via status file This adds an entry ``loader`` on the ``notes`` hash in the status table by means of which the fontloader can be specified. The status file is read when building the configuration table, and if it is present the entry in the ``loader`` table will be used as the default fontloader. Otherwise, Luaotfload falls back on the reference loader. --- scripts/mkstatus | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'scripts/mkstatus') diff --git a/scripts/mkstatus b/scripts/mkstatus index 9e10c03..809d4af 100755 --- a/scripts/mkstatus +++ b/scripts/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 @@ -158,26 +159,35 @@ hash_all = function (list, acc) end local handle_argv = function (argv) + local ret = { files = { }, loader = nil } local argc = #argv - if argc < 1 then return { } end + if argc < 1 then return ret end local argoff = 1 if argv [1] == "-v" then verbose = true - if argc == 1 then return { } end + 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" and lfs.isfile (cur) then - acc[#acc + 1] = cur + 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 ({ }, argoff) + return aux (ret, argoff) end local add_files @@ -196,9 +206,10 @@ end local main = function () local raw_extra = handle_argv (arg) - local cuit_extra = add_files (raw_extra) + 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) -- cgit v1.2.3