From 368728d968dd75b237fd69bc3e4d21b6503e96dc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 25 Jul 2021 18:09:03 +0000 Subject: no need for extra block just for $texpool declaration? git-svn-id: svn://tug.org/texlive/trunk@60057 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 77 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index ba00242710d..b2c21473b04 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -774,55 +774,54 @@ sub rebuild_one_format { . "$prgswitch $texargs"; print_verbose("running \`$cmdline' ...\n"); - { - my $texpool = $ENV{'TEXPOOL'}; - if ($localpool) { - $ENV{'TEXPOOL'} = cwd() . $sep . ($texpool ? $texpool : ""); - } + my $texpool = $ENV{'TEXPOOL'}; + if ($localpool) { + $ENV{'TEXPOOL'} = cwd() . $sep . ($texpool ? $texpool : ""); + } - # in mktexfmtMode we must redirect *all* output to stderr - $cmdline .= " >&2" if $mktexfmtMode; - $cmdline .= " <$nul"; - my $retval = system("$DRYRUN$cmdline"); - - # report error if it failed. - if ($retval != 0) { - $retval /= 256 if ($retval > 0); - print_deferred_error("running \`$cmdline' return status: $retval\n"); - } + # in mktexfmtMode we must redirect *all* output to stderr + $cmdline .= " >&2" if $mktexfmtMode; + $cmdline .= " <$nul"; + my $retval = system("$DRYRUN$cmdline"); - # Copy the log file after the program is run, so that the log file - # is available to inspect even on failure. So we need the dest dir tree. - TeXLive::TLUtils::mkdirhier($destdir) if ! $opts{"dry-run"}; - # + # report error if it failed. + if ($retval != 0) { + $retval /= 256 if ($retval > 0); + print_deferred_error("running \`$cmdline' return status: $retval\n"); + } + + # Copy the log file after the program is run, so that the log file + # is available to inspect even on failure. So we need the dest dir tree. + TeXLive::TLUtils::mkdirhier($destdir) if ! $opts{"dry-run"}; + # + if ($opts{"dry-run"}) { + print_info("would copy log file to: $destdir/$logfile\n"); + } else { # Here and in the following we use copy instead of move # to make sure that in SElinux enabled cases the rules of # the destination directory are applied. # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900580 - if ($opts{"dry-run"}) { - print_info("would copy log file to: $destdir/$logfile\n"); + # + if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) { + print_info("log file copied to: $destdir/$logfile\n"); } else { - if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) { - print_info("log file copied to: $destdir/$logfile\n"); - } else { - print_deferred_error("failed to copy log $logfile to: $destdir\n"); - } + print_deferred_error("failed to copy log $logfile to: $destdir\n"); } + } - # original shell script did *not* check the return value - # we keep this behavior, but add an option --strict that - # errors out on all failures. - if ($retval != 0 && $opts{'strict'}) { - print_deferred_error("returning error due to option --strict\n"); - return $FMT_FAILURE; - } + # original shell script did *not* check the return value + # we keep this behavior, but add an option --strict that + # errors out on all failures. + if ($retval != 0 && $opts{'strict'}) { + print_deferred_error("returning error due to option --strict\n"); + return $FMT_FAILURE; + } - if ($localpool) { - if ($texpool) { - $ENV{'TEXPOOL'} = $texpool; - } else { - delete $ENV{'TEXPOOL'}; - } + if ($localpool) { + if ($texpool) { + $ENV{'TEXPOOL'} = $texpool; + } else { + delete $ENV{'TEXPOOL'}; } } -- cgit v1.2.3