texlive[47250] trunk: lwarp (2apr18)

commits+karl at tug.org commits+karl at tug.org
Mon Apr 2 23:21:55 CEST 2018


Revision: 47250
          http://tug.org/svn/texlive?view=revision&revision=47250
Author:   karl
Date:     2018-04-02 23:21:55 +0200 (Mon, 02 Apr 2018)
Log Message:
-----------
lwarp (2apr18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/texmf-dist/doc/latex/lwarp/README.txt
    trunk/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf
    trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua
    trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2018-04-02 21:16:13 UTC (rev 47249)
+++ trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2018-04-02 21:21:55 UTC (rev 47250)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.52"
+printversion = "v0.53"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -25,10 +25,11 @@
 lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty.
 lwarpmk pdftohtml [project]:
     For use with latexmk or a Makefile:
-    Convert project_html.pdf to project_html.html and
-    individual HTML files.
+    Converts project_html.pdf to project_html.html and individual HTML files.
+    Finishes the HTML conversion even if there was a compile error.
 lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl*
 lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html
+lwarpmk cleanlimages: Removes all images from the "lateximages" directory.
 lwarpmk -h: Print this help message.
 lwarpmk --help: Print this help message.
 
@@ -335,6 +336,8 @@
 end -- create lwarp_one_limage.cmd
 -- Track the number of parallel processes
 numimageprocesses = 0
+-- Track warning to recompile if find a page 0
+pagezerowarning = false
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -344,7 +347,9 @@
 -- For each entry:
 if ( (i~=nil) ) then
 -- Skip if the page number is 0:
-if ( lwimgpage ~= "0" ) then
+if ( lwimgpage == "0" ) then
+    pagezerowarning = true
+else
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -425,6 +430,12 @@
 end -- do
 io.close(limagesfile)
 print ( "lwarpmk limages: done" )
+if ( pagezerowarning == true ) then
+    print ( "lwarpmk limages: WARNING: Images will be incorrect." )
+    print ( "lwarpmk limages:   Enter \"lwarpmk cleanlimages\", then" )
+    print ( "lwarpmk limages:   recompile the document one more time, then" )
+    print ( "lwarpmk limages:   repeat \"lwarpmk images\" again." )
+end -- pagezerowarning
 end -- function
 
 -- Use latexmk to compile source and index:
@@ -638,6 +649,14 @@
     )
 print ("lwarpmk: Done.")
 
+-- lwarpmk cleanlimages
+-- Remove images from the lateximages directory.
+
+elseif arg[1] == "cleanlimages" then
+loadconf ()
+os.execute ( rmname .. " lateximages/*" )
+print ("lwarpmk: Done.")
+
 -- lwarpmk with no argument :
 
 elseif (arg[1] == nil) then

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2018-04-02 21:16:13 UTC (rev 47249)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2018-04-02 21:21:55 UTC (rev 47250)
@@ -1,12 +1,12 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 47132 2018-03-26 17:19:25Z karl $
+# $Id: tlmgr.pl 47220 2018-04-01 03:20:33Z preining $
 #
 # Copyright 2008-2018 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-my $svnrev = '$Revision: 47132 $';
-my $datrev = '$Date: 2018-03-26 19:19:25 +0200 (Mon, 26 Mar 2018) $';
+my $svnrev = '$Revision: 47220 $';
+my $datrev = '$Date: 2018-04-01 05:20:33 +0200 (Sun, 01 Apr 2018) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -28,6 +28,7 @@
 our $pinfile;
 our $action; # for the pod2usage -sections call
 our %opts;
+our $allowed_verify_args_regex = qr/^(none|main|all)$/i;
 
 END {
   if ($opts{"pause"}) {
@@ -362,6 +363,7 @@
   "print-platform-info" => 1,
   "usermode|user-mode" => 1,
   "usertree|user-tree" => "=s",
+  "verify-repo" => "=s",
   "verify-downloads" => "!",
   "require-verification" => "!",
   "version" => 1,
@@ -479,6 +481,22 @@
     $action = "remove";
   }
 
+  #
+  # check for correctness of verify-repo argument
+  if (defined($opts{"verify-repo"}) &&
+      ($opts{"verify-repo"} !~ m/$allowed_verify_args_regex/)) {
+    tldie("$prg: unknown value for --verify-repo: $opts{'verify-repo'}\n");
+  }
+  # convert command line crypto options
+  $opts{"verify-repo"} = convert_crypto_options($opts{"verify-downloads"}, $opts{"require-verification"}, $opts{"verify-repo"});
+  if (defined($opts{"verify-downloads"}) || defined($opts{"require-verification"})) {
+    tlwarn("$prg: please use -verify-repo options instead of verify-downloads/require-verification\n" .
+           "$prg: adjusting --verify-repo=$opts{'verify-repo'}\n");
+  }
+  delete $opts{"require-verification"};
+  delete $opts{"verify-downloads"};
+
+
   # now $action should be part of %actionoptions, otherwise this is
   # an error
   if (defined($action) && $action && !exists $action_specification{$action}) {
@@ -1781,7 +1799,8 @@
     return ($F_ERROR);
   }
   $localtlpdb->remove_package($pkg);
-  TeXLive::TLPDB->_install_data($restore_file , 0, [] ,$localtlpdb);
+  # the -1 force the TLUtils::unpack to NOT warn about missing checksum/sizes
+  TeXLive::TLPDB->_install_data($restore_file , 0, [], $localtlpdb, "-1", "-1");
   logpackage("restore: $pkg ($rev)");
   # now we have to read the .tlpobj file and add it to the DB
   my $tlpobj = TeXLive::TLPOBJ->new;
@@ -1978,7 +1997,11 @@
         }
       }
     } else {
-      print "No backups available in $opts{'backupdir'}\n";
+      if ($opts{'json'}) {
+        print "[]\n";
+      } else {
+        print "No backups available in $opts{'backupdir'}\n";
+      }
     }
     return ($F_OK | $F_NOPOSTACTION);
   }
@@ -3247,8 +3270,9 @@
           $unwind_package = $newname;
         }
 
+        # the -1 force the TLUtils::unpack to NOT warn about missing checksum/sizes
         my ($instret, $msg) = TeXLive::TLUtils::unpack("$unwind_package",
-          $localtlpdb->root);
+          $localtlpdb->root, checksum => "-1", checksize => "-1");
         if ($instret) {
           # now we have to include the tlpobj
           my $tlpobj = TeXLive::TLPOBJ->new;
@@ -6199,7 +6223,7 @@
   # keys which can be set/get and are also settable via global cmdline opts
   my @valid_bool_keys
     = qw/debug-translation machine-readable no-execute-actions
-         require-verification verify-downloads json/;  
+         verify-repo json/;  
   my @valid_string_keys = qw/repository prompt/;
   my @valid_keys = (@valid_bool_keys, @valid_string_keys);
   # set auto flush unconditionally in action shell
@@ -6518,26 +6542,26 @@
   # setup gpg if available
   # by default we setup gpg
   # default value
-  my $do_setup_gpg = 1;
+  my $do_setup_gpg = "main";
   # the value is set in the config file
-  if (defined($config{'verify-downloads'})) {
-    $do_setup_gpg = $config{'verify-downloads'};
+  if (defined($config{'verify-repo'})) {
+    $do_setup_gpg = $config{'verify-repo'};
   }
   # command line
-  if (defined($opts{'verify-downloads'})) {
-    $do_setup_gpg = $opts{'verify-downloads'};
+  if (defined($opts{'verify-repo'})) {
+    $do_setup_gpg = $opts{'verify-repo'};
   }
   # now we know whether we setup gpg or not
-  if ($do_setup_gpg) {
+  if ($do_setup_gpg ne "none") {
     if (TeXLive::TLCrypto::setup_gpg($Master)) {
       debug("will verify cryptographic signatures\n")
     } else {
       my $prefix = "$prg: No gpg found"; # just to shorten the strings
-      if ($opts{'verify-downloads'}) {
+      if ($opts{'verify-repo'} eq "all") {
         # verification was requested on the command line, but did not succeed, die
         tldie("$prefix, verification explicitly requested on command line, quitting.\n");
       }
-      if ($config{'verify-downloads'}) {
+      if ($config{'verify-repo'} eq "all") {
         # verification explicitly requested in config file, but not gpg, die
         tldie("$prefix, verification explicitly requested in config file, quitting.\n");
       }
@@ -6549,12 +6573,12 @@
   } else {
     # we do not setup gpg: when explicitly requested, be silent, otherwise info
     my $prefix = "$prg: not setting up gpg";
-    if (defined($opts{'verify-downloads'})) {
+    if (defined($opts{'verify-repo'})) {
       # log normally is *NOT* logged to a file
       # tlmgr does by default *NOT* set up a log file (cmd line option)
       # user requested it, so don't bother with output
       debug("$prefix, requested on command line\n");
-    } elsif (defined($config{'verify-downloads'})) {
+    } elsif (defined($config{'verify-repo'})) {
       debug("$prefix, requested in config file\n");
     } else {
       tldie("$prg: how could this happen? gpg setup.\n");
@@ -6976,8 +7000,8 @@
   # first set default values
   $config{"gui-expertmode"} = 1;
   $config{"auto-remove"} = 1;
-  $config{"require-verification"} = 0;
   $config{"persistent-downloads"} = 1;
+  $config{"verify-repo"} = "main";
   # do NOT set this here, we distinguish between explicitly set in the config file
   # or implicitly true
   # $config{"verify-downloads"} = 1;
@@ -6994,6 +7018,15 @@
   $tlmgr_config_file = TeXLive::TLConfFile->new($fn, "#", "=");
   load_options_from_config($tlmgr_config_file) if $tlmgr_config_file;
 
+  $config{"verify-repo"} = convert_crypto_options($config{"verify-downloads"}, $config{"require-verification"}, $config{"verify-repo"});
+  delete $config{"require-verification"};
+  delete $config{"verify-downloads"};
+
+  # TODO TODO
+  # rename old crypto options
+  #
+  # TODO TODO
+  # what should we do with this?
   # set $opts{"key"} from $config{"key"} if not passed in on cmd line
   if (!defined($opts{"require-verification"})) {
     $opts{"require-verification"} = $config{"require-verification"};
@@ -7063,6 +7096,13 @@
         tlwarn("$prg: $fn: Unknown value for verify-downloads: $val\n");
       }
 
+    } elsif ($key eq "verify-repo") {
+      if ($val =~ m/$allowed_verify_args_regex/) {
+        $config{"verify-repo"} = $val;
+      } else {
+        tlwarn("$prg: $fn: Unknown value for verify-repo: $val\n");
+      }
+
     } elsif ($key eq "no-checksums") {
       if ($val eq "1") {
         $config{"no-checksums"} = 1;
@@ -7110,6 +7150,54 @@
   }
 }
 
+sub convert_crypto_options {
+  my ($verify_downloads, $require_verification, $verify_repo) = @_;
+
+  # leave undefined to deal with case that nothing has been passed in
+  my $ret;
+
+  # crypto options rewriting
+  if ((defined($verify_downloads) || defined($require_verification)) &&
+      defined($verify_repo)) {
+    # we cannot have all three, warn and bail out
+    tldie("$prg: The options verify-downloads and require-verification have been\n" .
+          "$prg: superseeded by verify-repo, please use only the later on!\n");
+  }
+  # return immediately if verify_repo is already set
+  return($verify_repo) if (defined($verify_repo));
+
+  if (defined($verify_downloads)) {
+    if ($verify_downloads) {
+      # explicit --verify-downloads was given
+      if ($require_verification) {
+        # --require-verification was given
+        $ret = "all";
+      } else {
+        # either nothing passed or --no-require-verification (default)
+        # use explit setting to main
+        $ret = "main";
+      }
+    } else {
+      # explicit --no-verify-downloads was given
+      if ($require_verification) {
+        # --require-verification was given
+        tldie("You cannot ask for no verification and require it at the same time!\n");
+      } else {
+        $ret = "none";
+      }
+    }
+  } else {
+    # nothing related to verify-download was given, so it is by default
+    # set to true
+    if ($require_verification) {
+      $ret = "all";
+    } else {
+      # dont set anything, as nothing has been passed in
+    }
+  }
+  return($ret);
+}
+
 # if the packagelog variable is set then write to PACKAGELOG filehandle
 #
 sub logpackage {
@@ -7432,16 +7520,6 @@
 (see L</Pinning> below).  Documented only for completeness, as this is
 only useful in debugging.
 
-=item B<--require-verification>
-
-=item B<--no-require-verification>
-
-Verify that all remote repositories to be correctly signed, or quit.
-With C<--no-require-verification>, all verification is omitted.  By
-default, verification is performed (but not required) if GnuPG and the
-relevant keys are available. See L<CRYPTOGRAPHIC VERIFICATION> below for
-details.
-
 =item B<--usermode>
 
 Activates user mode for this run of C<tlmgr>; see L<USER MODE> below.
@@ -7450,14 +7528,13 @@
 
 Uses I<dir> for the tree in user mode; see L<USER MODE> below.
 
-=item B<--verify-downloads>
+=item B<--verify-repo=[none|main|all]>
 
-=item B<--no-verify-downloads>
-
-Enables or disables cryptographic verification of all downloaded
-database files.  A working GnuPG (C<gpg>) binary needs to be present in
-the path, otherwise this option has no effect.  By default, the main
-repository is verified, while any other repositories are not verified.
+Defines the level of verification done: If C<none> is passed, no
+verification whatsoever is done. If C<main> and a working GnuPG (C<gpg>)
+binary is available, all repositories are checked, but only the main 
+repository is required to be signed. If C<all> then all repositories
+need to be signed.
 See L<CRYPTOGRAPHIC VERIFICATION> below for details.
 
 =back
@@ -9027,14 +9104,18 @@
 C<gpg> is not available, signatures are not checked and no verification
 is carried out, but C<tlmgr> proceeds normally.
 
-The attempted verification can be suppressed entirely by specifying
-C<--no-verify-downloads> on the command line, or a line
-C<verify-downloads=0> in a C<tlmgr> config file (see L<CONFIGURATION
-FILE FOR TLMGR>).  On the other hand, you can I<require> successful
-verification by specifying C<--require-verification> on the command
-line, or C<require-verification=1> in a C<tlmgr> config file; in this
-case, if verification is not possible, or fails, the program quits.
+The behaviour of the verification can be controlled by the command line 
+and config file option C<verify-repo> which takes one of the following
+values: C<none>, C<main>, or C<all>. In case of C<none>, no verification
+whatsoever is attempted, similar to the case when not GnuPG can be found.
+In case of C<main> (the default) verification is required only for
+the main repository, but attempted for all. Missing signatures of
+subsidiary repositories will not result in an error.
+Finally, in the case of C<all>, all repositories need to be signed.
 
+In all cases when a signature is checked and fails to verify, an error
+is raised.
+
 Cryptographic verification requires checksum checking (described just
 above) to succeed, and a working GnuPG (C<gpg>) program (see below for
 search method).  Then, unless cryptographic verification has been
@@ -9620,7 +9701,7 @@
 distribution (L<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 47132 2018-03-26 17:19:25Z karl $
+$Id: tlmgr.pl 47220 2018-04-01 03:20:33Z preining $
 =cut
 
 # to remake HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/texmf-dist/doc/latex/lwarp/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2018-04-02 21:16:13 UTC (rev 47249)
+++ trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2018-04-02 21:21:55 UTC (rev 47250)
@@ -1,5 +1,5 @@
 
-LaTeX lwarp package v0.52   README.txt
+LaTeX lwarp package v0.53   README.txt
 
 Files included are:
 

Modified: trunk/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2018-04-02 21:16:13 UTC (rev 47249)
+++ trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2018-04-02 21:21:55 UTC (rev 47250)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.52"
+printversion = "v0.53"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -25,10 +25,11 @@
 lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty.
 lwarpmk pdftohtml [project]:
     For use with latexmk or a Makefile:
-    Convert project_html.pdf to project_html.html and
-    individual HTML files.
+    Converts project_html.pdf to project_html.html and individual HTML files.
+    Finishes the HTML conversion even if there was a compile error.
 lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl*
 lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html
+lwarpmk cleanlimages: Removes all images from the "lateximages" directory.
 lwarpmk -h: Print this help message.
 lwarpmk --help: Print this help message.
 
@@ -335,6 +336,8 @@
 end -- create lwarp_one_limage.cmd
 -- Track the number of parallel processes
 numimageprocesses = 0
+-- Track warning to recompile if find a page 0
+pagezerowarning = false
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -344,7 +347,9 @@
 -- For each entry:
 if ( (i~=nil) ) then
 -- Skip if the page number is 0:
-if ( lwimgpage ~= "0" ) then
+if ( lwimgpage == "0" ) then
+    pagezerowarning = true
+else
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -425,6 +430,12 @@
 end -- do
 io.close(limagesfile)
 print ( "lwarpmk limages: done" )
+if ( pagezerowarning == true ) then
+    print ( "lwarpmk limages: WARNING: Images will be incorrect." )
+    print ( "lwarpmk limages:   Enter \"lwarpmk cleanlimages\", then" )
+    print ( "lwarpmk limages:   recompile the document one more time, then" )
+    print ( "lwarpmk limages:   repeat \"lwarpmk images\" again." )
+end -- pagezerowarning
 end -- function
 
 -- Use latexmk to compile source and index:
@@ -638,6 +649,14 @@
     )
 print ("lwarpmk: Done.")
 
+-- lwarpmk cleanlimages
+-- Remove images from the lateximages directory.
+
+elseif arg[1] == "cleanlimages" then
+loadconf ()
+os.execute ( rmname .. " lateximages/*" )
+print ("lwarpmk: Done.")
+
 -- lwarpmk with no argument :
 
 elseif (arg[1] == nil) then

Modified: trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2018-04-02 21:16:13 UTC (rev 47249)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2018-04-02 21:21:55 UTC (rev 47250)
@@ -16,7 +16,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{lwarp}
-%<package>    [2018/04/01 v0.52  Allows LaTeX to directly produce HTML5 output.]
+%<package>    [2018/04/01 v0.53  Allows LaTeX to directly produce HTML5 output.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -2062,7 +2062,7 @@
 %<*package>
 % \fi
 %
-% \CheckSum{23333}
+% \CheckSum{23337}
 %
 % \CharacterTable
 % {Upper-case     \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -2156,6 +2156,7 @@
 % \changes{v0.50}{2018/03/03}{\ 2018/03/03}
 % \changes{v0.51}{2018/03/24}{\ 2018/03/24}
 % \changes{v0.52}{2018/04/01}{\ 2018/04/01}
+% \changes{v0.53}{2018/04/01}{\ 2018/04/01}
 
 
 
@@ -2349,6 +2350,15 @@
 %
 % \begin{description}
 % \needspace{2\baselineskip}
+% \item[v0.53:] \
+%   \begin{itemize}
+%       \item \prog{lwarpmk}: Added a warning about corrupted images due to the
+%           \margintag{\prog{lwarpmk}}
+%           need to recompile the document one more time.
+%       \item \prog{lwarpmk}: Added the \cmds{lwarpmk cleanlimages} command.
+%       \item Added documentation for \cmds{lwarpmk cleanlimages} and
+%           \cmds{lwarpmk pdftohtml}.
+%   \end{itemize}
 % \item[v0.52:] \
 %   \begin{itemize}
 %       \item Improved install instructions regarding \filenm{lwarp\_baseline\_marker.png}.
@@ -4569,6 +4579,23 @@
 %	\userentry{lwarpmk cleanall}
 %
 %
+% \subsection{Cleaning the images from the \filenm{lateximages} directory}
+% \changes{v0.53}{2018/04/01}{Docs: \cmds{lwarpmk cleanlimages}.}
+%
+% To remove the images from the \filenm{lateximages} directory, including
+% all \SVG\ math images:
+%   \userentry{lwarpmk cleanlimages}
+%
+%
+% \subsection{Creating HTML from an incomplete compile}
+% \changes{v0.53}{2018/04/01}{Docs: \cmds{lwarpmk pdftohtml}.}
+%
+% During testing it may be useful to finish the \HTML\ conversion even when
+% the document had errors and did not compile successfully.  To attempt an
+% \HTML\ conversion of an incomplete document:
+%   \userentry{lwarpmk pdftohtml [project]}
+%
+%
 % \subsection{Processing multiple projects in the same directory}
 %
 % It is possible to have several projects in the same directory.
@@ -11838,6 +11865,8 @@
 % \changes{v0.51}{2018/03/16}{\prog{lwarpmk}: \prog{pdftocairo} \optn{-noshrink} added.}
 % \changes{v0.52}{2018/03/31}{\prog{lwarpmk}: Fix: Memory overflow when spawning tasks.}
 % \changes{v0.52}{2018/04/01}{\prog{lwarpmk}: Fix: Skip image generation if from page 0.}
+% \changes{v0.53}{2018/04/01}{\prog{lwarpmk}: Adds warning for corrupted images.}
+% \changes{v0.53}{2018/04/01}{\prog{lwarpmk}: Adds \cmds{lwarpmk cleanlimages}.}
 %
 % The following is only generated if the \optn{lwarpmk} option
 %   was given to \pkg{lwarp}.
@@ -11854,7 +11883,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.52"
+printversion = "v0.53"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -11875,10 +11904,11 @@
 lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty.
 lwarpmk pdftohtml [project]:
     For use with latexmk or a Makefile:
-    Convert project_html.pdf to project_html.html and
-    individual HTML files.
+    Converts project_html.pdf to project_html.html and individual HTML files.
+    Finishes the HTML conversion even if there was a compile error.
 lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl*
 lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html
+lwarpmk cleanlimages: Removes all images from the "lateximages" directory.
 lwarpmk -h: Print this help message.
 lwarpmk --help: Print this help message.
 
@@ -12192,6 +12222,8 @@
 end -- create lwarp_one_limage.cmd
 -- Track the number of parallel processes
 numimageprocesses = 0
+-- Track warning to recompile if find a page 0
+pagezerowarning = false
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -12201,7 +12233,9 @@
 -- For each entry:
 if ( (i~=nil) ) then
 -- Skip if the page number is 0:
-if ( lwimgpage ~= "0" ) then
+if ( lwimgpage == "0" ) then
+    pagezerowarning = true
+else
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -12282,6 +12316,12 @@
 end -- do
 io.close(limagesfile)
 print ( "lwarpmk limages: done" )
+if ( pagezerowarning == true ) then
+    print ( "lwarpmk limages: WARNING: Images will be incorrect." )
+    print ( "lwarpmk limages:   Enter \"lwarpmk cleanlimages\", then" )
+    print ( "lwarpmk limages:   recompile the document one more time, then" )
+    print ( "lwarpmk limages:   repeat \"lwarpmk images\" again." )
+end -- pagezerowarning
 end -- function
 
 
@@ -12498,6 +12538,14 @@
     )
 print ("lwarpmk: Done.")
 
+-- lwarpmk cleanlimages
+-- Remove images from the lateximages directory.
+
+elseif arg[1] == "cleanlimages" then
+loadconf ()
+os.execute ( rmname .. " lateximages/*" )
+print ("lwarpmk: Done.")
+
 -- lwarpmk with no argument :
 
 elseif (arg[1] == nil) then

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2018-04-02 21:16:13 UTC (rev 47249)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2018-04-02 21:21:55 UTC (rev 47250)
@@ -17,7 +17,7 @@
 %% version 2005/12/01 or later.
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{lwarp}
-    [2018/04/01 v0.52  Allows LaTeX to directly produce HTML5 output.]
+    [2018/04/01 v0.53  Allows LaTeX to directly produce HTML5 output.]
 
 
 
@@ -3075,7 +3075,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.52"
+printversion = "v0.53"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -3096,10 +3096,11 @@
 lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty.
 lwarpmk pdftohtml [project]:
     For use with latexmk or a Makefile:
-    Convert project_html.pdf to project_html.html and
-    individual HTML files.
+    Converts project_html.pdf to project_html.html and individual HTML files.
+    Finishes the HTML conversion even if there was a compile error.
 lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl*
 lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html
+lwarpmk cleanlimages: Removes all images from the "lateximages" directory.
 lwarpmk -h: Print this help message.
 lwarpmk --help: Print this help message.
 
@@ -3406,6 +3407,8 @@
 end -- create lwarp_one_limage.cmd
 -- Track the number of parallel processes
 numimageprocesses = 0
+-- Track warning to recompile if find a page 0
+pagezerowarning = false
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -3415,7 +3418,9 @@
 -- For each entry:
 if ( (i~=nil) ) then
 -- Skip if the page number is 0:
-if ( lwimgpage ~= "0" ) then
+if ( lwimgpage == "0" ) then
+    pagezerowarning = true
+else
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -3496,6 +3501,12 @@
 end -- do
 io.close(limagesfile)
 print ( "lwarpmk limages: done" )
+if ( pagezerowarning == true ) then
+    print ( "lwarpmk limages: WARNING: Images will be incorrect." )
+    print ( "lwarpmk limages:   Enter \"lwarpmk cleanlimages\", then" )
+    print ( "lwarpmk limages:   recompile the document one more time, then" )
+    print ( "lwarpmk limages:   repeat \"lwarpmk images\" again." )
+end -- pagezerowarning
 end -- function
 
 -- Use latexmk to compile source and index:
@@ -3709,6 +3720,14 @@
     )
 print ("lwarpmk: Done.")
 
+-- lwarpmk cleanlimages
+-- Remove images from the lateximages directory.
+
+elseif arg[1] == "cleanlimages" then
+loadconf ()
+os.execute ( rmname .. " lateximages/*" )
+print ("lwarpmk: Done.")
+
 -- lwarpmk with no argument :
 
 elseif (arg[1] == nil) then



More information about the tex-live-commits mailing list