diff options
author | Norbert Preining <preining@logic.at> | 2020-10-17 06:08:28 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2020-10-17 06:08:28 +0000 |
commit | 4fb633bbfdd2c22d88f14df6584f0ab33b2e4994 (patch) | |
tree | 311dfccd81ea08508dbad769bb1ef69bc7014320 /Master/texmf-dist/scripts | |
parent | 4d5e70e3f9f7bbd05933b10d25ad7ef35b4f1415 (diff) |
remove duplicated code in fmtutil
git-svn-id: svn://tug.org/texlive/trunk@56682 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 41 |
1 files 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"); } + } } } |