On Mon, May 16, 2016 at 9:47 PM, Brian R. Landy <br...@landy.cx> wrote:

>
> Hi, I noticed today that when running "context --jit" that return codes
> were not being passed back properly to the shell.
>
> For example, with a simple file like this (text.tex):
>
>   \starttext
>   test\par
>   \mybadmacro\par
>   \stoptext
>
> context --jit --nonstopmode test.tex ; echo ", RC=$?"
>
> The log output will print:
>
>   mtx-context     | fatal error: return code: 1, RC=0
>
> But the shell return code is zero.  The below patch fixes it (I'm no Lua
> expert so perhaps there is a better approach):
>
>   --- a/tex/texmf-context/scripts/context/lua/mtx-context.lua
>   +++ b/tex/texmf-context/scripts/context/lua/mtx-context.lua
>   @@ -108,7 +108,7 @@ local function restart(engine_old,engine_new)
>        local command = format("%s --luaonly %q %s
>
>  
> --redirected",engine_new,environment.ownname,environment.reconstructcommandline())
>        report(format("redirect %s -> %s:
>        %s",engine_old,engine_new,command))
>        local result = os.execute(command)
>   -    os.exit(result)
>   +    os.exit(result/256)
>    end
>
>
> Best regards,
> Brian
> _______________________________________________
> dev-context mailing list
> dev-context@ntg.nl
> https://mailman.ntg.nl/mailman/listinfo/dev-context
>

hm

$ contextjit --nonstopmode test.tex 2>&1 >/dev/null ; echo $?
1
$ context --jit --nonstopmode test.tex 2>&1 >/dev/null ; echo $?
0
$ context  --nonstopmode test.tex 2>&1 >/dev/null ; echo $?
1

Thank you for the report
-- 
luigi
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-context

Reply via email to