From c44cc5bdbd852739631251c53d3119bc006172d3 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 28 Nov 2015 02:15:47 +0000 Subject: format triggers git-svn-id: svn://tug.org/texlive/trunk@38966 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 48 ++++++++++-------------------- 1 file changed, 15 insertions(+), 33 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index cc587a02718..dfe36bfcd58 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -823,28 +823,6 @@ sub handle_execute_actions { } } - # - # check if *depending* formats have been changed - # we are currently only caring for package "latex" and "tex". If - # one of these has changed, we search for all packages *depending* - # on latex/tex and regenerate all formats in these packages. - # - # do this only if we are not in --list or --dry-run mode - if (!$opts{"list"}) { - my @check_indirect_formats; - for my $p (@::fmt_triggers) { - push @check_indirect_format, $localtlpdb->triggered_by($p); - } - for my $p (@check_indirect_formats) { - my $tlp = $localtlpdb->get_package($p); - if (!defined($tlp)) { - tlwarn("$p mentioned but not found in local tlpdb, strange!\n"); - next; - } - TeXLive::TLUtils::announce_execute_actions("enable", $tlp, "format"); - } - } - # 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 @@ -3457,18 +3435,22 @@ END_DISK_WARN sub check_announce_format_triggers { # we treat new and updated packages the same as updated # when it comes to triggers - my (@updpacks) = @_; - - tlwarn(" - TODO TODO TODO - Here we need somehow to call out for all packages update - we need to loop over all packages, and collect all trigger.FORMAT\n"); - - # old code - if ($updated{"latex"} || $updated{"babel"}) { - TeXLive::TLUtils::announce_execute_actions("latex-updated"); + my %updpacks = map { $_ => 1 } @_; + + # search all format definitions in the tlpdb + FMTDEF: for my $fmtdef ($localtlpdb->format_definitions) { + # if by default they are activated, check the whether the + # trigger packages appear in the list of updated/new packages + if (($fmtdef->{'mode'} == 1) && $fmtdef->{'triggers'}) { + for my $trigger (@{$fmtdef->{'triggers'}}) { + if ($updpacks{$trigger}) { + TeXLive::TLUtils::announce_execute_actions("rebuild-format", + 0, $fmtdef); + next FMTDEF; + } + } + } } - TeXLive::TLUtils::announce_execute_actions("tex-updated") if ($updated{"tex"}); } # INSTALL -- cgit v1.2.3