From 83f2b77b7a2644f214ac4080c7b5deeeb7b1f3fb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 22 Apr 2021 00:51:54 +0000 Subject: fmtutil: warn on shadowing formats git-svn-id: svn://tug.org/texlive/trunk@58959 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) -- cgit v1.2.3