diff options
author | Norbert Preining <norbert@preining.info> | 2021-04-21 11:32:31 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-05-09 10:58:56 +0900 |
commit | fa5a3bb748fdde0210e90c6cb43f8557d4c0369e (patch) | |
tree | 9a81b6ee5207eaee42abdc8cb97af3bf4d87db7b | |
parent | fa6951f56b5d3dcc12df3039172d77c7fcfdb2f3 (diff) |
fmtutil: warn on shadowing formats
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index ca2eac40259..3882fc2a87e 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -587,12 +587,28 @@ sub select_and_rebuild_format { } } if ($doit) { + check_and_warn_on_user_format($fmt,$eng); return rebuild_one_format($fmt,$eng,$kpsefmt,$destdir,$fmtfile,$logfile); } else { return $FMT_NOTSELECTED; } } +sub check_and_warn_on_user_format { + my ($fmt, $eng) = @_; + # do nothing if we are updating files in $TEXMFVAR + return if ($opts{'fmtdir'} eq $TEXMFVAR); + my $saved_fmtdir = $opts{'fmtdir'}; + $opts{'fmtdir'} = "$TEXMFVAR/web2c"; + my ($kpsefmt, $destdir, $fmtfile, $logfile) = compute_format_destination($fmt, $eng); + if (-r "$destdir/$fmtfile") { + print_deferred_warning("you have a shadowing format dump in TEXMFVAR for $fmt/$eng!!!\n"); + } + $opts{'fmtdir'} = $saved_fmtdir; +} + + + # compute_format_destination # takes fmt/eng and returns the locations where format and log files # should be saved, that is, a list: (dump file full path, log file full path) |