texlive[51406] trunk: latexmk (19jun19)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 19 22:35:59 CEST 2019


Revision: 51406
          http://tug.org/svn/texlive?view=revision&revision=51406
Author:   karl
Date:     2019-06-19 22:35:59 +0200 (Wed, 19 Jun 2019)
Log Message:
-----------
latexmk (19jun19)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
    trunk/Master/texmf-dist/doc/man/man1/latexmk.1
    trunk/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
    trunk/Master/texmf-dist/doc/support/latexmk/CHANGES
    trunk/Master/texmf-dist/doc/support/latexmk/INSTALL
    trunk/Master/texmf-dist/doc/support/latexmk/README
    trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc
    trunk/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
    trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt
    trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl	2019-06-19 20:35:59 UTC (rev 51406)
@@ -162,6 +162,8 @@
 ##
 ## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
 ##
+## 28 Jun 2019 John Collins  Try to deal with log file parsing problems
+##                           V. 4.65
 ## 21 May 2019 John Collins  Fix incorrect listings by -rules and by -deps
 ## 21 May 2019 John Collins  V. 4.64a.
 ## 20,21 May 2019 John Collins Fix problem with not always running dvipdf,
@@ -231,8 +233,8 @@
 
 $my_name = 'latexmk';
 $My_name = 'Latexmk';
-$version_num = '4.64a';
-$version_details = "$My_name, John Collins, 21 May 2019";
+$version_num = '4.65';
+$version_details = "$My_name, John Collins, 18 June 2019";
 
 use Config;
 use File::Basename;
@@ -4714,11 +4716,24 @@
             # Latex error/warning, etc.
             next LINE;
         }
-        elsif ( /^\\openout\d+\s*=\s*\`([^\']+)\'\.$/ ) {
-                #  When (pdf)latex is run with an -output-directory 
-                #    or an -aux_directory, the file name does not contain
-                #    the output path; fix this, after removing quotes:
-            $generated_log{normalize_force_directory( $aux_dir1, $1 )} = 1;
+        elsif ( /^\\openout\d+\s*=\s*(.*)\s*$/ ) {
+            # \openout followed by filename followed by line end.
+            # pdflatex and xelatex quote it and wrap,
+            # lualatex leaves filename as is, and doesn't wrap.
+            my $cand = $1;
+            if ( $cand =~ /\`\"([^\'\"]+)\"\'\.$/ ) {
+                # One form of quoting by pdflatex, xelatex: `"..."'.
+                $cand = $1;
+            }
+            elsif ( $cand =~ /\`([^\']+)\'\.$/ ) {
+                # Another form of quoting by pdflatex, xelatex: `...'.
+                $cand = $1;
+            }
+            if ( $cand =~ /[\`\'\"]/){
+                # Bad quotes: e.g., incomplete wrapped line
+                next LINE;
+            }
+            $generated_log{normalize_force_directory( $aux_dir1, $cand )} = 1;
             next LINE;
         }
         # Test for conversion produced by package:
@@ -4934,6 +4949,11 @@
                # Quoted file name, as from MikTeX
                 $quoted = 1;
             }
+            elsif ( /^\"/ ) {
+                # Incomplete quoted file, as in wrapped line before appending
+                # next line
+                next LINE;
+            }
             elsif ( /^([^\(^\)]*?)\s+[\[\{\<]/ ) {
                 # Terminator: space then '[' or '{' or '<'
                 # Use *? in condition: to pick up first ' [' (etc) 
@@ -4952,12 +4972,20 @@
             $_ = $';       # Put $_ equal to the unmatched tail of string '
             my $include_candidate = $1;
             $include_candidate =~ s/\s*$//;   # Remove trailing space.
-            if ( !$quoted && ($include_candidate =~ /(\S+)\s/ ) ){
+            if ($quoted) {
+            # Remove quotes around filename.
+                $include_candidate =~ s/^\"(.*)\"$/$1/;
+            }
+            elsif ( !$quoted && ($include_candidate =~ /(\S+)\s/ ) ){
                 # Non-space-containing filename-candidate
                 # followed by space followed by message
                 # (Common)
                 push @new_includes, $1;
             }
+            if ($include_candidate =~ /[\"\'\`]/) {
+                # Quote inside filename.  Probably misparse.
+                next INCLUDE_CANDIDATE;
+            }
             if ( $include_candidate eq "[]" ) {
                 # Part of overfull hbox message
                 next INCLUDE_CANDIDATE;
@@ -4966,9 +4994,6 @@
                 # Part of font message
                 next INCLUDE_CANDIDATE;
             }
-            # Remove quotes around filename, as for MikTeX.  I've already
-            # treated this as a special case.  For safety check here:
-            $include_candidate =~ s/^\"(.*)\"$/$1/;
 
             push @new_includes, $include_candidate;
             if ( $include_candidate =~ /^(.+)\[([^\]]+)\]$/ ) {
@@ -4987,6 +5012,10 @@
 
     INCLUDE_NAME:
         foreach my $include_name (@new_includes) {
+            if ($include_name =~ /[\"\'\`]/) {
+                # Quote inside filename.  Probably misparse.
+                next INCLUDE_NAME;
+            }
             $include_name = normalize_filename( $include_name, @pwd_log );
             my ($base, $path, $ext) = fileparseB( $include_name );
             if ( ($path eq './') || ($path eq '.\\') ) {
@@ -8517,10 +8546,13 @@
         if (! defined $_) { $_ = ''; }
     }
     if ( ($source =~ /\"/) || ($dest =~ /\"/) || ($base =~ /\"/) ) {
-        die "$My_name: Error. In rdb_create_rule there is a double quote in one of\n",
-            "  source, destination or base parameters:\n",
-            "    '$source', '$dest', '$base'\n",
-            "  I cannot handle this.\n";
+        die "$My_name: Error. In rdb_create_rule to create rule\n",
+            "    '$rule',\n",
+            "  there is a double quote in one of source, destination or base parameters:\n",
+            "    '$source'\n",
+            "    '$dest'\n",
+            "    '$base'\n",
+            "  I cannot handle this.  Cause is probably a latexmk bug.  Please report it.\n";
     }
     foreach ( $needs_making, $run_time, $check_time, $test_kind ) {
         if (! defined $_) { $_ = 0; }

Modified: trunk/Master/texmf-dist/doc/man/man1/latexmk.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/latexmk.1	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/doc/man/man1/latexmk.1	2019-06-19 20:35:59 UTC (rev 51406)
@@ -1,4 +1,4 @@
-.TH LATEXMK 1 "21 May 2019" ""
+.TH LATEXMK 1 "18 June 2019" ""
 .SH NAME
 latexmk \- generate LaTeX document
 .SH SYNOPSIS
@@ -3801,7 +3801,7 @@
 harvested too easily.)
 .SH AUTHOR
 Current version, by John Collins (username jcc8 at node psu.edu).
-(Version 4.64a).
+(Version 4.65).
 
 Released version can be obtained from CTAN:
 <http://www.ctan.org/pkg/latexmk/>, and from the

Modified: trunk/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexmk/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/CHANGES	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/doc/support/latexmk/CHANGES	2019-06-19 20:35:59 UTC (rev 51406)
@@ -687,4 +687,6 @@
 From v. 4.64 to 4.64a
   Fix incorrect listings by -rules and by -deps
 
-
+From v. 4.64a to 4.65
+  Fix incorrect parsing of long quoted filenames in log file that sometimes
+    prevented latexmk from running.

Modified: trunk/Master/texmf-dist/doc/support/latexmk/INSTALL
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/INSTALL	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/doc/support/latexmk/INSTALL	2019-06-19 20:35:59 UTC (rev 51406)
@@ -1,6 +1,6 @@
             INSTALLING latexmk
             ==================
-      (Version 4.64a, 21 May 2019)
+      (Version 4.65, 18 June 2019)
 
             John Collins
             Physics Department

Modified: trunk/Master/texmf-dist/doc/support/latexmk/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/README	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/doc/support/latexmk/README	2019-06-19 20:35:59 UTC (rev 51406)
@@ -1,4 +1,4 @@
-Latexmk, version 4.64a, 21 May 2019
+Latexmk, version 4.65, 18 June 2019
 -----------------------------------
 
 Latexmk completely automates the process of generating a LaTeX
@@ -87,7 +87,7 @@
 
 John Collins
 ---------------------------- "latexmk -h" ----------------------------
-Latexmk 4.64a: Automatic LaTeX document generation routine
+Latexmk 4.65: Automatic LaTeX document generation routine
 
 Usage: latexmk [latexmk_options] [filename ...]
 

Modified: trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc	2019-06-19 20:35:59 UTC (rev 51406)
@@ -1,4 +1,4 @@
-# This shows how to implement the use different values for $aux_dir and
+# This shows how to implement the use of different values for $aux_dir and
 # $out_dir when the latex (etc) engines don't support the -aux-directory
 # option.  (Of the standard distributions, MiKTeX supports -aux-directory,
 # but TeXLive does not.)
@@ -14,24 +14,48 @@
 
 sub latex_fix_aux {
   # Fudge to allow use of -aux_directory option with non-MiKTeX system.
-  # Just communicate by arguments, and don't use latexmk's variables
-  # $aux_dir, etc.
+  # This subroutine is called to do a compilation by one of latex, pdflatex,
+  # etc.  It's arguments are the command name, and the command-line arguments,
+  # including possible uses of the options -aux-directory, -output-directory.
+  # Functioning:
+  # 1. Obtain the values of the aux and output directories from the options
+  #    on the command line, with appropriate defaults if one or both options
+  #    is not used.
+  # 2. Change the command line (a) to avoid the use of the -aux-directory
+  #    option, and (b) to use the -output-directory to get all output
+  #    sent to the intended aux-directory.  If neither an  -aux-directory
+  #    nor an -output-directory option is used, no change is made to the
+  #    command line.
+  # 3. Run the command.
+  # 4. If the aux and output directories are different, move any of the dvi,
+  #    fls, ps and pdf files that are present in the intended aux directory
+  #    to the intended output directory.
+  # N.B. It might seem more appropriate to keep the fls file in the aux
+  #    directory.  But MiKTeX puts it in the output directory, so we must do
+  #    the same to copy its behavior.
+  #    It might also seem appropriate for an xdv file to go in the output
+  #    directory, like a dvi file.  But xelatex under MiKTeX puts it in the
+  #    aux directory, so we must copy that behavior.
+
+  # Determine aux and output directories from command line:
   my $auxD = '';
   my $outD = '';
   foreach (@_) {
-     if ( /^-aux-directory=(.*)$/ ) {
+     if ( /^-{1,2}aux-directory=(.*)$/ ) {
         $auxD = $1;
      }
-     elsif ( /^-output-directory=(.*)$/ ) {
+     elsif ( /^-{1,2}output-directory=(.*)$/ ) {
         $outD = $1;
      }
   }
   if ( $outD eq '' ) { $outD = '.'; }
   if ( $auxD eq '' ) { $auxD = $outD; }
+
+# Construct modified command line, with at most one occurrence of -output-directory
   my @args_act = ();
   my $set_outD = 0;
   foreach (@_) {
-     if ( /^-(aux|output)-directory=.*$/ ) {
+     if ( /^-{1,2}(aux|output)-directory=.*$/ ) {
         if ( ! $set_outD ) {
 	   push @args_act, "-output-directory=$auxD";
 	   $set_outD = 1;
@@ -41,12 +65,20 @@
         push @args_act, $_;
      }
   }
+
+# Construct strings for aux and output directories that are suitable
+# for prepending to a file name, so that they have any necessary
+# directory separators:
   my $outD1 = $outD;
   my $auxD1 = $auxD;
   foreach ( $auxD1, $outD1 ) {
+     # Append directory separator '/', but only for a non-empty name
+     # that isn't simple an MSWin drive name.
      if ( ($_ ne '')  && ! m([\\/\:]$) ) {
         $_ .= '/';
      }
+     # Clean up by removing any sequence of './'. These refer to
+     # current directory.
      while ( s[^\.\/][] ) {}
    }
 

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

Modified: trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt	2019-06-19 20:35:59 UTC (rev 51406)
@@ -61,7 +61,7 @@
 
 
 
-                                  21 May 2019                                1
+                                 18 June 2019                                1
 
 
 
@@ -127,7 +127,7 @@
 
 
 
-                                  21 May 2019                                2
+                                 18 June 2019                                2
 
 
 
@@ -193,7 +193,7 @@
 
 
 
-                                  21 May 2019                                3
+                                 18 June 2019                                3
 
 
 
@@ -259,7 +259,7 @@
 
 
 
-                                  21 May 2019                                4
+                                 18 June 2019                                4
 
 
 
@@ -325,7 +325,7 @@
 
 
 
-                                  21 May 2019                                5
+                                 18 June 2019                                5
 
 
 
@@ -391,7 +391,7 @@
 
 
 
-                                  21 May 2019                                6
+                                 18 June 2019                                6
 
 
 
@@ -457,7 +457,7 @@
 
 
 
-                                  21 May 2019                                7
+                                 18 June 2019                                7
 
 
 
@@ -523,7 +523,7 @@
 
 
 
-                                  21 May 2019                                8
+                                 18 June 2019                                8
 
 
 
@@ -589,7 +589,7 @@
 
 
 
-                                  21 May 2019                                9
+                                 18 June 2019                                9
 
 
 
@@ -655,7 +655,7 @@
 
 
 
-                                  21 May 2019                               10
+                                 18 June 2019                               10
 
 
 
@@ -721,7 +721,7 @@
 
 
 
-                                  21 May 2019                               11
+                                 18 June 2019                               11
 
 
 
@@ -787,7 +787,7 @@
 
 
 
-                                  21 May 2019                               12
+                                 18 June 2019                               12
 
 
 
@@ -853,7 +853,7 @@
 
 
 
-                                  21 May 2019                               13
+                                 18 June 2019                               13
 
 
 
@@ -919,7 +919,7 @@
 
 
 
-                                  21 May 2019                               14
+                                 18 June 2019                               14
 
 
 
@@ -985,7 +985,7 @@
 
 
 
-                                  21 May 2019                               15
+                                 18 June 2019                               15
 
 
 
@@ -1051,7 +1051,7 @@
 
 
 
-                                  21 May 2019                               16
+                                 18 June 2019                               16
 
 
 
@@ -1117,7 +1117,7 @@
 
 
 
-                                  21 May 2019                               17
+                                 18 June 2019                               17
 
 
 
@@ -1183,7 +1183,7 @@
 
 
 
-                                  21 May 2019                               18
+                                 18 June 2019                               18
 
 
 
@@ -1249,7 +1249,7 @@
 
 
 
-                                  21 May 2019                               19
+                                 18 June 2019                               19
 
 
 
@@ -1315,7 +1315,7 @@
 
 
 
-                                  21 May 2019                               20
+                                 18 June 2019                               20
 
 
 
@@ -1381,7 +1381,7 @@
 
 
 
-                                  21 May 2019                               21
+                                 18 June 2019                               21
 
 
 
@@ -1447,7 +1447,7 @@
 
 
 
-                                  21 May 2019                               22
+                                 18 June 2019                               22
 
 
 
@@ -1513,7 +1513,7 @@
 
 
 
-                                  21 May 2019                               23
+                                 18 June 2019                               23
 
 
 
@@ -1579,7 +1579,7 @@
 
 
 
-                                  21 May 2019                               24
+                                 18 June 2019                               24
 
 
 
@@ -1645,7 +1645,7 @@
 
 
 
-                                  21 May 2019                               25
+                                 18 June 2019                               25
 
 
 
@@ -1711,7 +1711,7 @@
 
 
 
-                                  21 May 2019                               26
+                                 18 June 2019                               26
 
 
 
@@ -1777,7 +1777,7 @@
 
 
 
-                                  21 May 2019                               27
+                                 18 June 2019                               27
 
 
 
@@ -1843,7 +1843,7 @@
 
 
 
-                                  21 May 2019                               28
+                                 18 June 2019                               28
 
 
 
@@ -1909,7 +1909,7 @@
 
 
 
-                                  21 May 2019                               29
+                                 18 June 2019                               29
 
 
 
@@ -1975,7 +1975,7 @@
 
 
 
-                                  21 May 2019                               30
+                                 18 June 2019                               30
 
 
 
@@ -2041,7 +2041,7 @@
 
 
 
-                                  21 May 2019                               31
+                                 18 June 2019                               31
 
 
 
@@ -2107,7 +2107,7 @@
 
 
 
-                                  21 May 2019                               32
+                                 18 June 2019                               32
 
 
 
@@ -2173,7 +2173,7 @@
 
 
 
-                                  21 May 2019                               33
+                                 18 June 2019                               33
 
 
 
@@ -2239,7 +2239,7 @@
 
 
 
-                                  21 May 2019                               34
+                                 18 June 2019                               34
 
 
 
@@ -2305,7 +2305,7 @@
 
 
 
-                                  21 May 2019                               35
+                                 18 June 2019                               35
 
 
 
@@ -2371,7 +2371,7 @@
 
 
 
-                                  21 May 2019                               36
+                                 18 June 2019                               36
 
 
 
@@ -2437,7 +2437,7 @@
 
 
 
-                                  21 May 2019                               37
+                                 18 June 2019                               37
 
 
 
@@ -2503,7 +2503,7 @@
 
 
 
-                                  21 May 2019                               38
+                                 18 June 2019                               38
 
 
 
@@ -2569,7 +2569,7 @@
 
 
 
-                                  21 May 2019                               39
+                                 18 June 2019                               39
 
 
 
@@ -2635,7 +2635,7 @@
 
 
 
-                                  21 May 2019                               40
+                                 18 June 2019                               40
 
 
 
@@ -2701,7 +2701,7 @@
 
 
 
-                                  21 May 2019                               41
+                                 18 June 2019                               41
 
 
 
@@ -2767,7 +2767,7 @@
 
 
 
-                                  21 May 2019                               42
+                                 18 June 2019                               42
 
 
 
@@ -2833,7 +2833,7 @@
 
 
 
-                                  21 May 2019                               43
+                                 18 June 2019                               43
 
 
 
@@ -2899,7 +2899,7 @@
 
 
 
-                                  21 May 2019                               44
+                                 18 June 2019                               44
 
 
 
@@ -2965,7 +2965,7 @@
 
 
 
-                                  21 May 2019                               45
+                                 18 June 2019                               45
 
 
 
@@ -3031,7 +3031,7 @@
 
 
 
-                                  21 May 2019                               46
+                                 18 June 2019                               46
 
 
 
@@ -3097,7 +3097,7 @@
 
 
 
-                                  21 May 2019                               47
+                                 18 June 2019                               47
 
 
 
@@ -3163,7 +3163,7 @@
 
 
 
-                                  21 May 2019                               48
+                                 18 June 2019                               48
 
 
 
@@ -3229,7 +3229,7 @@
 
 
 
-                                  21 May 2019                               49
+                                 18 June 2019                               49
 
 
 
@@ -3295,7 +3295,7 @@
 
 
 
-                                  21 May 2019                               50
+                                 18 June 2019                               50
 
 
 
@@ -3361,7 +3361,7 @@
 
 
 
-                                  21 May 2019                               51
+                                 18 June 2019                               51
 
 
 
@@ -3427,7 +3427,7 @@
 
 
 
-                                  21 May 2019                               52
+                                 18 June 2019                               52
 
 
 
@@ -3493,7 +3493,7 @@
 
 
 
-                                  21 May 2019                               53
+                                 18 June 2019                               53
 
 
 
@@ -3559,7 +3559,7 @@
 
 
 
-                                  21 May 2019                               54
+                                 18 June 2019                               54
 
 
 
@@ -3625,7 +3625,7 @@
 
 
 
-                                  21 May 2019                               55
+                                 18 June 2019                               55
 
 
 
@@ -3691,7 +3691,7 @@
 
 
 
-                                  21 May 2019                               56
+                                 18 June 2019                               56
 
 
 
@@ -3757,7 +3757,7 @@
 
 
 
-                                  21 May 2019                               57
+                                 18 June 2019                               57
 
 
 
@@ -3823,7 +3823,7 @@
 
 
 
-                                  21 May 2019                               58
+                                 18 June 2019                               58
 
 
 
@@ -3889,7 +3889,7 @@
 
 
 
-                                  21 May 2019                               59
+                                 18 June 2019                               59
 
 
 
@@ -3955,7 +3955,7 @@
 
 
 
-                                  21 May 2019                               60
+                                 18 June 2019                               60
 
 
 
@@ -4021,7 +4021,7 @@
 
 
 
-                                  21 May 2019                               61
+                                 18 June 2019                               61
 
 
 
@@ -4087,7 +4087,7 @@
 
 
 
-                                  21 May 2019                               62
+                                 18 June 2019                               62
 
 
 
@@ -4153,7 +4153,7 @@
 
 
 
-                                  21 May 2019                               63
+                                 18 June 2019                               63
 
 
 
@@ -4219,7 +4219,7 @@
 
 
 
-                                  21 May 2019                               64
+                                 18 June 2019                               64
 
 
 
@@ -4285,7 +4285,7 @@
 
 
 
-                                  21 May 2019                               65
+                                 18 June 2019                               65
 
 
 
@@ -4351,7 +4351,7 @@
 
 
 
-                                  21 May 2019                               66
+                                 18 June 2019                               66
 
 
 
@@ -4417,7 +4417,7 @@
 
 
 
-                                  21 May 2019                               67
+                                 18 June 2019                               67
 
 
 
@@ -4483,7 +4483,7 @@
 
 
 
-                                  21 May 2019                               68
+                                 18 June 2019                               68
 
 
 
@@ -4530,7 +4530,7 @@
 
 AUTHOR
        Current version, by John  Collins  (username  jcc8  at  node  psu.edu).
-       (Version 4.64a).
+       (Version 4.65).
 
        Released      version      can      be      obtained     from     CTAN:
        <http://www.ctan.org/pkg/latexmk/>,  and  from  the  author's   website
@@ -4549,7 +4549,7 @@
 
 
 
-                                  21 May 2019                               69
+                                 18 June 2019                               69
 
 
 
@@ -4615,6 +4615,6 @@
 
 
 
-                                  21 May 2019                               70
+                                 18 June 2019                               70
 
 

Modified: trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl	2019-06-19 20:35:39 UTC (rev 51405)
+++ trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl	2019-06-19 20:35:59 UTC (rev 51406)
@@ -162,6 +162,8 @@
 ##
 ## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
 ##
+## 28 Jun 2019 John Collins  Try to deal with log file parsing problems
+##                           V. 4.65
 ## 21 May 2019 John Collins  Fix incorrect listings by -rules and by -deps
 ## 21 May 2019 John Collins  V. 4.64a.
 ## 20,21 May 2019 John Collins Fix problem with not always running dvipdf,
@@ -231,8 +233,8 @@
 
 $my_name = 'latexmk';
 $My_name = 'Latexmk';
-$version_num = '4.64a';
-$version_details = "$My_name, John Collins, 21 May 2019";
+$version_num = '4.65';
+$version_details = "$My_name, John Collins, 18 June 2019";
 
 use Config;
 use File::Basename;
@@ -4714,11 +4716,24 @@
             # Latex error/warning, etc.
             next LINE;
         }
-        elsif ( /^\\openout\d+\s*=\s*\`([^\']+)\'\.$/ ) {
-                #  When (pdf)latex is run with an -output-directory 
-                #    or an -aux_directory, the file name does not contain
-                #    the output path; fix this, after removing quotes:
-            $generated_log{normalize_force_directory( $aux_dir1, $1 )} = 1;
+        elsif ( /^\\openout\d+\s*=\s*(.*)\s*$/ ) {
+            # \openout followed by filename followed by line end.
+            # pdflatex and xelatex quote it and wrap,
+            # lualatex leaves filename as is, and doesn't wrap.
+            my $cand = $1;
+            if ( $cand =~ /\`\"([^\'\"]+)\"\'\.$/ ) {
+                # One form of quoting by pdflatex, xelatex: `"..."'.
+                $cand = $1;
+            }
+            elsif ( $cand =~ /\`([^\']+)\'\.$/ ) {
+                # Another form of quoting by pdflatex, xelatex: `...'.
+                $cand = $1;
+            }
+            if ( $cand =~ /[\`\'\"]/){
+                # Bad quotes: e.g., incomplete wrapped line
+                next LINE;
+            }
+            $generated_log{normalize_force_directory( $aux_dir1, $cand )} = 1;
             next LINE;
         }
         # Test for conversion produced by package:
@@ -4934,6 +4949,11 @@
                # Quoted file name, as from MikTeX
                 $quoted = 1;
             }
+            elsif ( /^\"/ ) {
+                # Incomplete quoted file, as in wrapped line before appending
+                # next line
+                next LINE;
+            }
             elsif ( /^([^\(^\)]*?)\s+[\[\{\<]/ ) {
                 # Terminator: space then '[' or '{' or '<'
                 # Use *? in condition: to pick up first ' [' (etc) 
@@ -4952,12 +4972,20 @@
             $_ = $';       # Put $_ equal to the unmatched tail of string '
             my $include_candidate = $1;
             $include_candidate =~ s/\s*$//;   # Remove trailing space.
-            if ( !$quoted && ($include_candidate =~ /(\S+)\s/ ) ){
+            if ($quoted) {
+            # Remove quotes around filename.
+                $include_candidate =~ s/^\"(.*)\"$/$1/;
+            }
+            elsif ( !$quoted && ($include_candidate =~ /(\S+)\s/ ) ){
                 # Non-space-containing filename-candidate
                 # followed by space followed by message
                 # (Common)
                 push @new_includes, $1;
             }
+            if ($include_candidate =~ /[\"\'\`]/) {
+                # Quote inside filename.  Probably misparse.
+                next INCLUDE_CANDIDATE;
+            }
             if ( $include_candidate eq "[]" ) {
                 # Part of overfull hbox message
                 next INCLUDE_CANDIDATE;
@@ -4966,9 +4994,6 @@
                 # Part of font message
                 next INCLUDE_CANDIDATE;
             }
-            # Remove quotes around filename, as for MikTeX.  I've already
-            # treated this as a special case.  For safety check here:
-            $include_candidate =~ s/^\"(.*)\"$/$1/;
 
             push @new_includes, $include_candidate;
             if ( $include_candidate =~ /^(.+)\[([^\]]+)\]$/ ) {
@@ -4987,6 +5012,10 @@
 
     INCLUDE_NAME:
         foreach my $include_name (@new_includes) {
+            if ($include_name =~ /[\"\'\`]/) {
+                # Quote inside filename.  Probably misparse.
+                next INCLUDE_NAME;
+            }
             $include_name = normalize_filename( $include_name, @pwd_log );
             my ($base, $path, $ext) = fileparseB( $include_name );
             if ( ($path eq './') || ($path eq '.\\') ) {
@@ -8517,10 +8546,13 @@
         if (! defined $_) { $_ = ''; }
     }
     if ( ($source =~ /\"/) || ($dest =~ /\"/) || ($base =~ /\"/) ) {
-        die "$My_name: Error. In rdb_create_rule there is a double quote in one of\n",
-            "  source, destination or base parameters:\n",
-            "    '$source', '$dest', '$base'\n",
-            "  I cannot handle this.\n";
+        die "$My_name: Error. In rdb_create_rule to create rule\n",
+            "    '$rule',\n",
+            "  there is a double quote in one of source, destination or base parameters:\n",
+            "    '$source'\n",
+            "    '$dest'\n",
+            "    '$base'\n",
+            "  I cannot handle this.  Cause is probably a latexmk bug.  Please report it.\n";
     }
     foreach ( $needs_making, $run_time, $check_time, $test_kind ) {
         if (! defined $_) { $_ = 0; }



More information about the tex-live-commits mailing list