From 3657b9c19c70eb0b52dfa1c67956776a6fd77d4a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 22 Apr 2014 07:15:12 +0200 Subject: [tool,db,conf] integrate defaults into new config model --- src/luaotfload-tool.lua | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'src/luaotfload-tool.lua') diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua index 5893d42..9b06ba9 100755 --- a/src/luaotfload-tool.lua +++ b/src/luaotfload-tool.lua @@ -95,18 +95,6 @@ config = config or { } local config = config local luaotfloadconfig = config.luaotfload or { } config.luaotfload = luaotfloadconfig -luaotfloadconfig.bisect = false -luaotfloadconfig.version = luaotfloadconfig.version or version -luaotfloadconfig.names_dir = luaotfloadconfig.names_dir or "names" -luaotfloadconfig.cache_dir = luaotfloadconfig.cache_dir or "fonts" -luaotfloadconfig.index_file = luaotfloadconfig.index_file - or "luaotfload-names.lua" -luaotfloadconfig.formats = luaotfloadconfig.formats - or "otf,ttf,ttc,dfont" -luaotfloadconfig.reload = false -if not luaotfloadconfig.strip then - luaotfloadconfig.strip = true -end config.lualibs = config.lualibs or { } config.lualibs.verbose = false @@ -147,11 +135,11 @@ require"luaotfload-basics-gen.lua" texio.write, texio.write_nl = backup.write, backup.write_nl utilities = backup.utilities -require"luaotfload-log.lua" --- this populates the luaotfload.log.* namespace -require"luaotfload-parsers" --- fonts.conf, configuration, and request syntax -require"luaotfload-configuration" --- configuration file handling -require"luaotfload-database" -require"alt_getopt" +require "luaotfload-log.lua" --- this populates the luaotfload.log.* namespace +require "luaotfload-parsers" --- fonts.conf, configuration, and request syntax +require "luaotfload-configuration" --- configuration file handling +require "luaotfload-database" +require "alt_getopt" local names = fonts.names local status_file = "luaotfload-status" @@ -757,10 +745,13 @@ actions.loglevel = function (job) end actions.config = function (job) - local config = luaotfload.config.read (job.extra_config) + local defaults = luaotfload.config.defaults + local vars = luaotfload.config.read (job.extra_config) + config.luaotfload = luaotfload.config.apply (defaults, vars) --if job.print_config == true then if true then - -- inspect (config) + --inspect (vars) + inspect (config.luaotfload) return true, false end return true, true -- cgit v1.2.3