diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-11-16 22:50:52 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-11-16 22:50:52 +0100 |
commit | c0a2db36cfa63da82ab9e0eb0eb952a14a899fa9 (patch) | |
tree | 70ec9a28ec574ee766ddfa318e043770a899fb9d | |
parent | 2be8db31dc0406e149a89c62bd628cfa6756ab30 (diff) | |
download | luaotfload-c0a2db36cfa63da82ab9e0eb0eb952a14a899fa9.tar.gz |
[db] complain about missing shell escape in log
-rw-r--r-- | luaotfload-database.lua | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 714c37c..c5c4c37 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -123,26 +123,6 @@ local luaotfloadconfig = config.luaotfload --- always present luaotfloadconfig.resolver = luaotfloadconfig.resolver or "normal" luaotfloadconfig.formats = luaotfloadconfig.formats or "otf,ttf,ttc,dfont" luaotfloadconfig.strip = luaotfloadconfig.strip == true ---- The “termwidth” value is only considered when printing ---- short status messages, e.g. when building the database ---- online. -if not luaotfloadconfig.termwidth then - local tw = 79 - if not ( os.type == "windows" --- Assume broken terminal. - or os.getenv "TERM" == "dumb") - and iopopen - then - local p = iopopen "tput cols" - if p then - result = p:read "*all" - p:close () - if result then - tw = tonumber (result) or tw - end - end - end - luaotfloadconfig.termwidth = tw -end --- this option allows for disabling updates --- during a TeX run @@ -176,6 +156,31 @@ local report_status = logs.names_status local report_status_start = logs.names_status_start local report_status_stop = logs.names_status_stop +--- The “termwidth” value is only considered when printing +--- short status messages, e.g. when building the database +--- online. +if not luaotfloadconfig.termwidth then + local tw = 79 + if not ( os.type == "windows" --- Assume broken terminal. + or os.getenv "TERM" == "dumb") + then + local p = iopopen "tput cols" + if p then + result = tonumber (p:read "*all") + p:close () + if result then + tw = result + else + report ("log", 2, "db", "tput returned non-number.") + end + else + report ("log", 2, "db", "Shell escape disabled or tput executable missing.") + report ("log", 2, "db", "Assuming 79 cols terminal width.") + end + end + luaotfloadconfig.termwidth = tw +end + names.patterns = { } local patterns = names.patterns |