From 4fb633bbfdd2c22d88f14df6584f0ab33b2e4994 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 17 Oct 2020 06:08:28 +0000 Subject: remove duplicated code in fmtutil git-svn-id: svn://tug.org/texlive/trunk@56682 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 41 ++++++++++------------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 93a8e9e2e3b..dab304429b3 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -407,32 +407,21 @@ sub callback_build_formats { my $nobuild = 0; my $notavail = 0; my $total = 0; - for my $fmt (keys %{$alldata->{'merged'}}) { - for my $eng (keys %{$alldata->{'merged'}{$fmt}}) { - next if ($fmt ne $eng); - $total++; - my $val = select_and_rebuild_format($fmt, $eng, $what, $whatarg); - if ($val == $FMT_DISABLED) { $disabled++; } - elsif ($val == $FMT_NOTSELECTED) { $nobuild++; } - elsif ($val == $FMT_FAILURE) { $err++; push (@err, "$eng/$fmt"); } - elsif ($val == $FMT_SUCCESS) { $suc++; } - elsif ($val == $FMT_NOTAVAIL) { $notavail++; } - else { print_error("callback_build_format (round 1): unknown return " - . "from select_and_rebuild.\n"); } - } - } - for my $fmt (keys %{$alldata->{'merged'}}) { - for my $eng (keys %{$alldata->{'merged'}{$fmt}}) { - next if ($fmt eq $eng); - $total++; - my $val = select_and_rebuild_format($fmt, $eng, $what, $whatarg); - if ($val == $FMT_DISABLED) { $disabled++; } - elsif ($val == $FMT_NOTSELECTED) { $nobuild++; } - elsif ($val == $FMT_FAILURE) { $err++; push (@err, "$eng/$fmt"); } - elsif ($val == $FMT_SUCCESS) { $suc++; } - elsif ($val == $FMT_NOTAVAIL) { $notavail++; } - else { print_error("callback_build_format (round 2): unknown return " - . "from select_and_rebuild.\n"); } + for my $swi (qw/format=engine format!=engine/) { + for my $fmt (keys %{$alldata->{'merged'}}) { + for my $eng (keys %{$alldata->{'merged'}{$fmt}}) { + next if ($swi eq "format=engine" && $fmt ne $eng); + next if ($swi eq "format!=engine" && $fmt eq $eng); + $total++; + my $val = select_and_rebuild_format($fmt, $eng, $what, $whatarg); + if ($val == $FMT_DISABLED) { $disabled++; } + elsif ($val == $FMT_NOTSELECTED) { $nobuild++; } + elsif ($val == $FMT_FAILURE) { $err++; push (@err, "$eng/$fmt"); } + elsif ($val == $FMT_SUCCESS) { $suc++; } + elsif ($val == $FMT_NOTAVAIL) { $notavail++; } + else { print_error("callback_build_format (round 1): unknown return " + . "from select_and_rebuild.\n"); } + } } } -- cgit v1.2.3