texlive[53457] trunk: ptex2pdf (19jan20)

commits+karl at tug.org commits+karl at tug.org
Sun Jan 19 22:36:06 CET 2020


Revision: 53457
          http://tug.org/svn/texlive?view=revision&revision=53457
Author:   karl
Date:     2020-01-19 22:36:06 +0100 (Sun, 19 Jan 2020)
Log Message:
-----------
ptex2pdf (19jan20)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua
    trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr
    trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexmf
    trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexpk
    trunk/Build/source/texk/texlive/linked_scripts/texlive/mktextfm
    trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md
    trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua

Modified: trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Build/source/texk/texlive/linked_scripts/ptex2pdf/ptex2pdf.lua	2020-01-19 21:36:06 UTC (rev 53457)
@@ -1,7 +1,7 @@
 #!/usr/bin/env texlua
 
 NAME = "ptex2pdf[.lua]"
-VERSION = "20181212.0"
+VERSION = "20200119.0"
 AUTHOR = "Norbert Preining"
 AUTHOREMAIL = "norbert at preining.info"
 SHORTDESC = "Convert Japanese TeX documents to pdf"
@@ -13,7 +13,7 @@
 by dvipdfmx.
 ]]
 USAGE = [[
-[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... 
+[texlua] ptex2pdf[.lua] { option | basename[.tex] } ...
 options: -v  version
          -h  help
          -help print full help (installation, TeXworks setup)
@@ -29,8 +29,8 @@
 LICENSECOPYRIGHT = [[
 Originally based on musixtex.lua from Bob Tennent.
 
-(c) Copyright 2016-2018 Japanese TeX Development Community
-(c) Copyright 2013-2018 Norbert Preining norbert at preining.info
+(c) Copyright 2016-2020 Japanese TeX Development Community
+(c) Copyright 2013-2020 Norbert Preining norbert at preining.info
 (c) Copyright 2012      Bob Tennent rdt at cs.queensu.ca
 
 This program is free software; you can redistribute it and/or modify it
@@ -174,11 +174,13 @@
   first replace all backslash chars to slash chars  
 - version 20170622.0  
   pass all non-optional arguments before filename to TeX engine  
-- version 20180514.0
+- version 20180514.0  
   Windows: for uptex use command_line_encoding=utf8, for all other turn
   it off (set to none)
-- version 20181212.0
+- version 20181212.0  
   support directories containing dots (thanks kn1cht)
+- version 20200119.0  
+  check invalid PATH string beforehand on windows
 ]]
 
 
@@ -338,7 +340,7 @@
     end
   end --if this_arg == ...
   narg = narg+1
-until narg > #arg 
+until narg > #arg
 
 whoami()
 
@@ -424,9 +426,17 @@
   dvipdfopts = "-o \"" .. bname .. ".pdf\""
 end
 print("Processing ".. filename)
-if (os.execute(tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\"") == 0) and
-   (dvipdf == "" or  (os.execute(dvipdf .. " " .. dvipdfopts .. " \"" .. bname .. ".dvi" .. "\"") == 0)) then 
-  if dvipdf ~= "" then 
+texcmd = tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\""
+tex_return = os.execute(texcmd)
+-- if os.execute(texcmd) returns -1 on Windows, then
+-- cmd.exe is not included in PATH, or some invalid string found before cmd.exe
+if os.type == 'windows' and tex_return == -1 then
+  print("Invalid PATH setting found. Please ensure that cmd.exe can be found.\n")
+end
+dvipdfcmd = dvipdf .. " " .. dvipdfopts .. " \"" .. bname .. ".dvi" .. "\""
+if tex_return == 0 and
+   (dvipdf == "" or (os.execute(dvipdfcmd) == 0)) then
+  if dvipdf ~= "" then
     print(bname .. ".pdf generated by " .. dvipdf .. ".")
   end
   if intermediate == 1 then -- clean-up:
@@ -436,8 +446,8 @@
   end
 else
   print("ptex2pdf processing of " .. filename .. " failed.\n")
-  print_ifdebug("tex = " .. tex)
-  print_ifdebug("dvipdf = " .. dvipdf)
+  print_ifdebug("tex = " .. texcmd)
+  print_ifdebug("dvipdf = " .. dvipdfcmd)
   os.exit(2)
 end
 

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexlsr	2020-01-19 21:36:06 UTC (rev 53457)
@@ -10,7 +10,7 @@
 # Originally written as `texhash' by Thomas Esser, Okt., 1994.
 # Public domain.
 
-version='$Id: mktexlsr 46343 2018-01-17 00:55:32Z preining $'
+version='$Id: mktexlsr 53254 2019-12-29 19:18:55Z karl $'
 progname=`echo $0 | sed 's%.*/%%'`
 
 usage="Usage: $progname [OPTION]... [DIR]...

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexmf
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexmf	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexmf	2020-01-19 21:36:06 UTC (rev 53457)
@@ -7,7 +7,7 @@
 # Originally written by Thomas Esser.
 # Public domain.
 
-version='$Id: mktexmf 34656 2014-07-18 23:38:50Z karl $'
+version='$Id: mktexmf 53254 2019-12-29 19:18:55Z karl $'
 
 # preferentially use subprograms from our own directory.
 mydir=`echo "$0" | sed 's,/[^/]*$,,'`

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexpk
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexpk	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/mktexpk	2020-01-19 21:36:06 UTC (rev 53457)
@@ -7,7 +7,7 @@
 # Originally written by Thomas Esser, Karl Berry, and Olaf Weber.
 # Public domain.
 
-version='$Id: mktexpk 34656 2014-07-18 23:38:50Z karl $'
+version='$Id: mktexpk 53254 2019-12-29 19:18:55Z karl $'
 progname=`echo $0 | sed 's%.*/%%'`
 
 # preferentially use subprograms from our own directory.

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/mktextfm
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/mktextfm	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/mktextfm	2020-01-19 21:36:06 UTC (rev 53457)
@@ -7,7 +7,7 @@
 # Primarily written by Thomas Esser, Karl Berry, and Olaf Weber.
 # Public domain.
 
-version='$Id: mktextfm 34656 2014-07-18 23:38:50Z karl $'
+version='$Id: mktextfm 53254 2019-12-29 19:18:55Z karl $'
 progname=`echo $0 | sed 's%.*/%%'`
 
 # preferentially use subprograms from our own directory.

Modified: trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Master/texmf-dist/doc/latex/ptex2pdf/README.md	2020-01-19 21:36:06 UTC (rev 53457)
@@ -17,7 +17,7 @@
 ## Usage ##
 
 `````
-[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... 
+[texlua] ptex2pdf[.lua] { option | basename[.tex] } ...
 options: -v  version
          -h  help
          -help print full help (installation, TeXworks setup)
@@ -160,18 +160,20 @@
   first replace all backslash chars to slash chars  
 - version 20170622.0  
   pass all non-optional arguments before filename to TeX engine  
-- version 20180514.0
+- version 20180514.0  
   Windows: for uptex use command_line_encoding=utf8, for all other turn
   it off (set to none)
-- version 20181212.0
+- version 20181212.0  
   support directories containing dots (thanks kn1cht)
+- version 20200119.0  
+  check invalid PATH string beforehand on windows
 
 ## Copyright and License ##
 
 Originally based on musixtex.lua from Bob Tennent.
 
-(c) Copyright 2016-2018 Japanese TeX Development Community
-(c) Copyright 2013-2018 Norbert Preining norbert at preining.info
+(c) Copyright 2016-2020 Japanese TeX Development Community
+(c) Copyright 2013-2020 Norbert Preining norbert at preining.info
 (c) Copyright 2012      Bob Tennent rdt at cs.queensu.ca
 
 This program is free software; you can redistribute it and/or modify it

Modified: trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua	2020-01-19 21:35:30 UTC (rev 53456)
+++ trunk/Master/texmf-dist/scripts/ptex2pdf/ptex2pdf.lua	2020-01-19 21:36:06 UTC (rev 53457)
@@ -1,7 +1,7 @@
 #!/usr/bin/env texlua
 
 NAME = "ptex2pdf[.lua]"
-VERSION = "20181212.0"
+VERSION = "20200119.0"
 AUTHOR = "Norbert Preining"
 AUTHOREMAIL = "norbert at preining.info"
 SHORTDESC = "Convert Japanese TeX documents to pdf"
@@ -13,7 +13,7 @@
 by dvipdfmx.
 ]]
 USAGE = [[
-[texlua] ptex2pdf[.lua] { option | basename[.tex] } ... 
+[texlua] ptex2pdf[.lua] { option | basename[.tex] } ...
 options: -v  version
          -h  help
          -help print full help (installation, TeXworks setup)
@@ -29,8 +29,8 @@
 LICENSECOPYRIGHT = [[
 Originally based on musixtex.lua from Bob Tennent.
 
-(c) Copyright 2016-2018 Japanese TeX Development Community
-(c) Copyright 2013-2018 Norbert Preining norbert at preining.info
+(c) Copyright 2016-2020 Japanese TeX Development Community
+(c) Copyright 2013-2020 Norbert Preining norbert at preining.info
 (c) Copyright 2012      Bob Tennent rdt at cs.queensu.ca
 
 This program is free software; you can redistribute it and/or modify it
@@ -174,11 +174,13 @@
   first replace all backslash chars to slash chars  
 - version 20170622.0  
   pass all non-optional arguments before filename to TeX engine  
-- version 20180514.0
+- version 20180514.0  
   Windows: for uptex use command_line_encoding=utf8, for all other turn
   it off (set to none)
-- version 20181212.0
+- version 20181212.0  
   support directories containing dots (thanks kn1cht)
+- version 20200119.0  
+  check invalid PATH string beforehand on windows
 ]]
 
 
@@ -338,7 +340,7 @@
     end
   end --if this_arg == ...
   narg = narg+1
-until narg > #arg 
+until narg > #arg
 
 whoami()
 
@@ -424,9 +426,17 @@
   dvipdfopts = "-o \"" .. bname .. ".pdf\""
 end
 print("Processing ".. filename)
-if (os.execute(tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\"") == 0) and
-   (dvipdf == "" or  (os.execute(dvipdf .. " " .. dvipdfopts .. " \"" .. bname .. ".dvi" .. "\"") == 0)) then 
-  if dvipdf ~= "" then 
+texcmd = tex .. " " .. texopts .. prefilename .. " \"" .. filename .. "\""
+tex_return = os.execute(texcmd)
+-- if os.execute(texcmd) returns -1 on Windows, then
+-- cmd.exe is not included in PATH, or some invalid string found before cmd.exe
+if os.type == 'windows' and tex_return == -1 then
+  print("Invalid PATH setting found. Please ensure that cmd.exe can be found.\n")
+end
+dvipdfcmd = dvipdf .. " " .. dvipdfopts .. " \"" .. bname .. ".dvi" .. "\""
+if tex_return == 0 and
+   (dvipdf == "" or (os.execute(dvipdfcmd) == 0)) then
+  if dvipdf ~= "" then
     print(bname .. ".pdf generated by " .. dvipdf .. ".")
   end
   if intermediate == 1 then -- clean-up:
@@ -436,8 +446,8 @@
   end
 else
   print("ptex2pdf processing of " .. filename .. " failed.\n")
-  print_ifdebug("tex = " .. tex)
-  print_ifdebug("dvipdf = " .. dvipdf)
+  print_ifdebug("tex = " .. texcmd)
+  print_ifdebug("dvipdf = " .. dvipdfcmd)
   os.exit(2)
 end
 



More information about the tex-live-commits mailing list