From d2a6bb90e56a2836bb59477b8f27248aab9149f5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 1 Oct 2020 03:04:13 +0000 Subject: CTAN sync 202010010304 --- support/latexmk/latexmk.pl | 209 +++++++++++++++++++++++---------------------- 1 file changed, 108 insertions(+), 101 deletions(-) (limited to 'support/latexmk/latexmk.pl') diff --git a/support/latexmk/latexmk.pl b/support/latexmk/latexmk.pl index 0f5c35988f..a05e938f91 100755 --- a/support/latexmk/latexmk.pl +++ b/support/latexmk/latexmk.pl @@ -36,7 +36,7 @@ use warnings; ## ?? Issues with clean-up ## List of aux files deleted is those read, not those generated. -## Other files are generated by (pdf)latex; should they be deleted? +## Other files are generated by *latex; should they be deleted? ## (I have hooks for this). @@ -162,6 +162,12 @@ use warnings; ## ## 12 Jan 2012 STILL NEED TO DOCUMENT some items below ## +## 29 Sep 2020 John Collins V. 4.70b. +## Correct switch_output. +## Try to ensure bibtex isn't given absolute pathname, when aux_dir +## is under current directory. (Otherwise bibtex isn't allowed +## to write a bbl file under default TeXLive settings.) +## Add options -bibfudge, -bibfudge-, -nobibfudge. ## 13 Sep 2020 John Collins V. 4.70a. Updates in comments about bibtex. ## 28 Aug 2020 John Collins Correct $biber and $bibtex to use %S not %B ## 24 Aug 2020 John Collins Make sure bibtex/biber rules when created for @@ -296,7 +302,6 @@ use warnings; ## ##----------------------------------------------------------------------- - ## Explicit exit codes: ## 10 = bad command line arguments ## 11 = file specified on command line not found @@ -308,8 +313,8 @@ use warnings; $my_name = 'latexmk'; $My_name = 'Latexmk'; -$version_num = '4.70a'; -$version_details = "$My_name, John Collins, 13 September 2020"; +$version_num = '4.70b'; +$version_details = "$My_name, John Collins, 29 September 2020"; use Config; use File::Basename; @@ -506,7 +511,7 @@ foreach ( 'dvi', 'dviF', 'ps', 'psF', 'pdf', 'synctex.gz', 'xdv' ) { # Information about options to latex and pdflatex that latexmk will simply -# pass through to (pdf)latex +# pass through to *latex # Option without arg. maps to itself. # Option with arg. maps the option part to the full specification # e.g., -kpathsea-debug => -kpathsea-debug=NUMBER @@ -611,7 +616,7 @@ foreach ( " called or a %& line.", ##### - # Options passed to (pdf)latex that have special processing by latexmk, + # Options passed to *latex that have special processing by latexmk, # so they are commented out here. #-jobname=STRING set the job name to STRING #-aux-directory=dir Set the directory dir to which auxiliary files are written @@ -619,7 +624,7 @@ foreach ( #-quiet #-recorder enable filename recorder # - # Options with different processing by latexmk than (pdf)latex + # Options with different processing by latexmk than *latex #-help #-version # @@ -1219,9 +1224,9 @@ $jobname = ''; # Jobname: as with current tex, etc indicates # useful when a jobname is used and latexmk is # invoked on multiple files. $out_dir = ''; # Directory for output files. - # Cf. --output-directory of current (pdf)latex + # Cf. --output-directory of current *latex $aux_dir = ''; # Directory for aux files (log, aux, etc). - # Cf. --aux-directory of current (pdf)latex in MiKTeX. + # Cf. --aux-directory of current *latex in MiKTeX. ## default flag settings. @@ -1253,14 +1258,14 @@ $analyze_input_log_always = 1; # Always analyze .log for input files in the # $analyze_input_log_always to 1. # The following two arrays contain lists of extensions (without -# period) for files that are read in during a (pdf)LaTeX run but that +# period) for files that are read in during a *LaTeX run but that # are generated automatically from the previous run, as opposed to # being user generated files (directly or indirectly from a custom # dependency). These files get two kinds of special treatment: # 1. In clean up, where depending on the kind of clean up, some # or all of these generated files are deleted. # (Note that special treatment is given to aux files.) -# 2. In analyzing the results of a run of (pdf)LaTeX, to +# 2. In analyzing the results of a run of *LaTeX, to # determine if another run is needed. With an error free run, # a rerun should be provoked by a change in any source file, # whether a user file or a generated file. But with a run @@ -1313,7 +1318,7 @@ $cleanup_fdb = 0; # No removal of file for latexmk's file-database $cleanup_only = 0; # When doing cleanup, do not go on to making files $cleanup_includes_generated = 0; # Determines whether cleanup deletes files generated by - # (pdf)latex (found from \openout lines in log file). + # *latex (found from \openout lines in log file). # It's more than that. BUG $cleanup_includes_cusdep_generated = 0; # Determines whether cleanup deletes files generated by @@ -1581,7 +1586,7 @@ $allow_switch = 1; # Allow switch of rule structure to accommodate # not a generated file (e.g., aux). This # kind of out-of-dateness should provoke a # rerun whether or not there was an error - # during a run of (pdf)LaTeX. Normally, + # during a run of *LaTeX. Normally, # if there is an error, one should wait # for the user to correct the error. But # it is possible the error condition is @@ -1781,13 +1786,15 @@ $bad_options = 0; while ($_ = $ARGV[0]) { # Make -- and - equivalent at beginning of option, - # but save original for possible use in (pdf)latex command line + # but save original for possible use in *latex command line $original = $_; s/^--/-/; shift; if ( /^-aux-directory=(.*)$/ || /^-auxdir=(.*)$/ ) { $aux_dir = $1; } + elsif (/^-bibfudge$/) { $bibtex_fudge = 1; } + elsif (/^-bibfudge-$/) { $bibtex_fudge = 0; } elsif (/^-bibtex$/) { $bibtex_use = 2; } elsif (/^-bibtex-$/) { $bibtex_use = 0; } elsif (/^-nobibtex$/) { $bibtex_use = 0; } @@ -1866,6 +1873,7 @@ while ($_ = $ARGV[0]) $auto_rc_use = 0; # N.B. This has already been obeyed. } + elsif (/^-nobibfudge$/) { $bibtex_fudge = 0; } elsif ( /^-output-directory=(.*)$/ ||/^-outdir=(.*)$/ ) { $out_dir = $1; } @@ -1929,16 +1937,16 @@ while ($_ = $ARGV[0]) elsif (/^-norules$/ || /^-rules-$/ ) { $rules_list = 0; } elsif (/^-showextraoptions$/) { print "List of extra latex and pdflatex options recognized by $my_name.\n", - "These are passed as is to (pdf)latex. They may not be recognized by\n", - "particular versions of (pdf)latex. This list is a combination of those\n", + "These are passed as is to *latex. They may not be recognized by\n", + "particular versions of *latex. This list is a combination of those\n", "for TeXLive and MikTeX.\n", "\n", "Note that in addition to the options in this list, there are several\n", - "options known to the (pdf)latex programs that are also recognized by\n", + "options known to the *latex programs that are also recognized by\n", "latexmk and trigger special behavior by latexmk. Since these options\n", "appear in the main list given by running 'latexmk --help', they do not\n", "appear in the following list\n", - "NOTE ALSO: Not all of these options are supported by all versions of (pdf)latex.\n", + "NOTE ALSO: Not all of these options are supported by all versions of *latex.\n", "\n"; foreach $option ( sort( keys %allowed_latex_options, keys %allowed_latex_options_with_arg ) ) { if (exists $allowed_latex_options{$option} ) { print " $allowed_latex_options{$option}\n"; } @@ -2239,7 +2247,7 @@ if ( $recorder ) { add_option( "-recorder", \$latex, \$pdflatex, \$lualatex, \$xelatex ); } -# If the output and/or aux directories are specified, fix the (pdf)latex +# If the output and/or aux directories are specified, fix the *latex # commands to use them. # N.B. We'll ensure that the directories actually exist only after a # possible cd to the document directory, since the directories can be @@ -2579,8 +2587,8 @@ foreach $filename ( @file_list ) local %dependents = (); # Maps files to status. Not used here. local @bbl_files = (); # Not used here. local %idx_files = (); # Maps idx_file to (ind_file, base). Not used here. - local %conversions = (); # (pdf)latex-performed conversions. Not used here. - # Maps output file created and read by (pdf)latex + local %conversions = (); # *latex-performed conversions. Not used here. + # Maps output file created and read by *latex # to source file of conversion. local $primary_out = ''; # Actual output file (dvi or pdf). Not used here. local $fls_file_analyzed = 0; @@ -2826,7 +2834,7 @@ if ($failure_count > 0) { if ( $where_log == 2 ) { warn "$My_name: You requested aux_dir '$aux_dir_requested',\n". - " but '$aux_dir' was used by the (pdf)latex engine.\n". + " but '$aux_dir' was used by the *latex engine.\n". " That indicates a configuration error.\n"; if ( ($tex_distribution !~ /^MiKTeX/i) && ($aux_dir_requested ne $out_dir_requested) ) { warn " Probably you set different aux and out directories,\n". @@ -2836,7 +2844,6 @@ if ( $where_log == 2 ) { } - # end MAIN PROGRAM ############################################################# ############################################################# @@ -3239,7 +3246,7 @@ sub one_from_main_rule_cache { warn "$My_name: Possible bug:\n", " In linking rules I already set from_rules_main{$$Pdest} to '$old_rule'\n", " But now I want to set it to '$rule'\n"; -#???? traceback(); +# traceback( "================================\nFrom one_from_main_rule_cache" ); } } $from_rules_main{$$Pdest} = $rule; @@ -3258,7 +3265,7 @@ sub one_from_rule_cache { # OK } elsif ( exists $from_rules_main{$_} && ( $from_rules_main{$_} ne $rule ) ) { - warn "$My_name: Possible problem:\n", + warn "$My_name: Possible bug:\n", " In linking rules, I already set from_rules_main{$_}\n". " to '$from_rules_main{$_}'\n", " But now I also have a different rule '$rule' that also made the file.\n"; @@ -3279,7 +3286,7 @@ sub one_from_rule_cache { warn "$My_name: Possible bug:\n", " In linking rules I already set from_rules{$_} to '$old_rule'\n", " But now I want to set it to '$rule'\n"; -#???? traceback(); +# traceback( "================================\nFrom one_from__rule_cache" ); } } $from_rules{$_} = $rule; @@ -3292,7 +3299,7 @@ sub set_trivial_aux_fdb { # 1. Write aux file EXACTLY as would be written if the tex file # had no cross references, etc. I.e., a minimal .aux file. # 2. Write a corresponding fdb file - # 3. Provoke a run of (pdf)latex (actually of all primaries). + # 3. Provoke a run of *latex (actually of all primaries). local *aux_file; open( aux_file, '>', $aux_main ) @@ -3679,13 +3686,13 @@ CHANGE: # There will be files changed during the run that are irrelevant. # We need to wait for the user to change the files. - # So set the GENERATED files from (pdf)latex as up-to-date: + # So set the GENERATED files from *latex as up-to-date: rdb_for_some( [keys %current_primaries], \&rdb_update_gen_files ); # And don't watch for changes for post_primary rules (ps and pdf - # from dvi, etc haven't been run after an error in (pdf)latex, so + # from dvi, etc haven't been run after an error in *latex, so # are out-of-date by filetime criterion, but they should not be run - # until after another (pdf)latex run: + # until after another *latex run: foreach (@post_primary) { delete $rules_to_watch{$_}; } $failure_msg =~ s/\s*$//; #Remove trailing space @@ -3918,8 +3925,9 @@ sub die_trace { #************************************************************ sub traceback { - # Call: &traceback - # or traceback( message, ) + # Call: traceback() + # or traceback( message ) + # NOT &traceback!!! my $msg = shift; if ($msg) { warn "$msg\n"; } warn "Traceback:\n"; @@ -3990,6 +3998,8 @@ sub print_help " -bibtex-cond - use bibtex when needed, but only if the bib file exists\n", " -bibtex-cond1 - use bibtex when needed, but only if the bib file exists;\n", " on cleanup delete bbl file only if bib file exists\n", + " -bibfudge - use change-directory fudge needed for old bibtexs\n", + " -bibfudge- - don't use change-directory fudge needed for old bibtexs\n", " -bm - Print message across the page when converting to postscript\n", " -bi - Set contrast or intensity of banner\n", " -bs - Set scale for banner\n", @@ -4030,11 +4040,11 @@ sub print_help " -l- - turn off -l\n", " -latex= - set program used for latex.\n", " (replace '' by the program name)\n", - " -latexoption=