From cb518f00d6f555ef49f18b12c7c8dcb2576d2956 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 9 Jun 2009 19:01:28 +0000 Subject: update all depending formats if an engine has been updated git-svn-id: svn://tug.org/texlive/trunk@13683 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 581ac3aff1f..10fa01371a7 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -478,17 +478,26 @@ sub handle_execute_actions { chomp(my $TEXMFLOCAL = `kpsewhich -var-value=TEXMFLOCAL`); - # format means create missing formats (because a new one was added). # format-regenerate is used when the paper size changes. In that # case, if option_create_formats is set, we simply want to generate - # all formats; if not, then we only want to refresh existing ones. # { + my %done_formats; + my %updated_engines; my %do_enable; my $do_full = 0; for my $m (keys %{$::execute_actions{'enable'}{'formats'}}) { $do_full = 1; $do_enable{$m} = 1; + # here we check whether an engine is updated + my %foo = %{$::execute_actions{'enable'}{'formats'}{$m}}; + if (!defined($foo{'name'}) || !defined($foo{'engine'})) { + tlwarn("Very strange error, please report " . %foo); + } else { + if ($foo{'name'} eq $foo{'engine'}) { + $updated_engines{$m} = 1; + } + } } for my $m (keys %{$::execute_actions{'disable'}{'formats'}}) { $do_full = 1; @@ -504,6 +513,26 @@ sub handle_execute_actions { for my $f (keys %do_enable) { info ("(re)creating format dump $f\n"); $errors += do_cmd_and_check("fmtutil-sys --byfmt $f"); + $done_formats{$f} = 1; + } + + # check that if an engine is updated that all formats that are based on + # that engine are also updated + my @upen = keys %updated_engines; + if (@upen) { + for my $d ($localtlpdb->format_definitions) { + my %def = %$d; + if (defined($def{'engine'})) { + next if defined($done_formats{$def{'name'}}); + for my $e (@upen) { + if ($def{'engine'} eq $e) { + info("updating format $def{'name'} (engine $e updated)\n"); + $errors += do_cmd_and_check("fmtutil-sys --byfmt $def{'name'}"); + $done_formats{$def{'name'}} = 1; + } + } + } + } } } } -- cgit v1.2.3