diff options
author | Norbert Preining <preining@logic.at> | 2017-05-07 09:20:39 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2017-05-07 09:20:39 +0000 |
commit | 330c975d98e85794aea5a07151b3456c86d37f76 (patch) | |
tree | d5eebf235032eb12062d95ac24b57a82d7bde686 /Master | |
parent | 0b834985e67711f29913c1683e59b20334839e3a (diff) |
update runscript for more sys/user scripts
git-svn-id: svn://tug.org/texlive/trunk@44235 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/bin/win32/runscript.tlu | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/Master/bin/win32/runscript.tlu b/Master/bin/win32/runscript.tlu index 376fc8c5e8f..c68239e7bb5 100755 --- a/Master/bin/win32/runscript.tlu +++ b/Master/bin/win32/runscript.tlu @@ -259,6 +259,9 @@ local docstr = [[ - Cater for fmtutil-user and updmap-user => -user arg 2017/04/24 - GS_LIB setting for tlgs. + 2017/05/06 + - introduce sys_user_progs, make checks for updmap/fmtutil + use sys_user_progs instead, add kanji-config-updmap ]] -- HELPER SUBROUTINES -- @@ -312,6 +315,16 @@ local function is_tex4ht_command(progname) return false end +-- checks whether an item is in an array +local function contains (tab, val) + for index, value in ipairs(tab) do + if value == val then + return true + end + end + return false +end + -- locates texmfscript to execute local function find_texmfscript(progname, ext_list) ext_list = ext_list or '\0' @@ -448,6 +461,7 @@ local userprog = (substcount > 0) -- true if there was a -user suffix removed -- prevent recursive calls to this script assert(progname ~= 'runscript', "oops! wrapping the wrapper?") + -- kpse and environment set-up -- init kpathsea @@ -455,11 +469,16 @@ local k = -1 while arg[k-1] do k = k - 1 end -- in case of a call: luatex --luaonly ... local lua_binary = arg[k] kpse.set_program_name(lua_binary, progname) + -- various dir-vars local TEXDIR = kpse.var_value('SELFAUTOPARENT') local TEXMFDIST = kpse.var_value('TEXMFDIST') local BINDIR = kpse.var_value('SELFAUTOLOC') local PATH = os.getenv('PATH') or '' + +-- list of programs that have -sys and -user variants +local sys_user_progs = { 'updmap', 'fmtutil', 'kanji-config-updmap' } + -- restricted programs local shell_escape_commands = string.lower(kpse.var_value('shell_escape_commands') or '') local is_restricted_progname = string.find( ','..shell_escape_commands..',', @@ -554,7 +573,7 @@ PATH = prepend_path(PATH, GSDIR, BINDIR) os.setenv('PATH', PATH); -- sys stuff -if (sysprog and not (progname == 'updmap') and not (progname == 'fmtutil')) then +if (sysprog and not contains(sys_user_progs, progname)) then os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR')) os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG')) end @@ -598,13 +617,7 @@ if is_tex4ht_command(progname) then progname = 'mk4ht' elseif progname == 'a2ping' then table.insert(extension_map['.pl'], '-x') -elseif progname == 'updmap' then - if sysprog then - argline = ' --sys ' .. argline - elseif userprog then - argline = ' --user ' .. argline - end -elseif progname == 'fmtutil' then +elseif contains(sys_user_progs, progname) then if sysprog then argline = ' --sys ' .. argline elseif userprog then |