summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texlive
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-08-03 21:55:56 +0000
committerKarl Berry <karl@freefriends.org>2021-08-03 21:55:56 +0000
commit6b2ce22416996077a4e7ea337d95e8e276231119 (patch)
treed473b4556f6ad7b06d0f7b0a2e3704a7e7cb5156 /Master/texmf-dist/scripts/texlive
parentbd479e2afc5123eff9327f6167d66f9e3b4eed34 (diff)
($first_time_usermode_warning): another global to
determine whether to output the "you are switching to usermode" warning. (main): if the determined $texmfvar matches $TEXMFSYSVAR (mktexfmt case), set the new variable. Since we are not in fact switching to usermode in this case. (callback_build_formats): don't issue the warning if the new variable is set. Other minor doc/style tweaks. git-svn-id: svn://tug.org/texlive/trunk@60154 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/texlive')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl23
1 files changed, 17 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl
index b2c21473b04..a32ada7fc2b 100755
--- a/Master/texmf-dist/scripts/texlive/fmtutil.pl
+++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl
@@ -8,7 +8,7 @@
# or any later version.
#
# History:
-# Original shell script (C) 2001 Thomas Esser, public domain
+# Original shell script 2001 Thomas Esser, public domain
my $TEXMFROOT;
@@ -61,6 +61,7 @@ my @deferred_stdout;
# $::opt_verbosity = 3; # manually enable debugging
my $first_time_creation_in_usermode = 0;
+my $first_time_usermode_warning = 1; # give lengthy warning if warranted?
my $DRYRUN = "";
my $STATUS_FH;
@@ -237,14 +238,22 @@ sub main {
$DRYRUN = "echo " if ($opts{'dry-run'});
- if ($opts{'status-file'}) {
- open $STATUS_FH, '>>', $opts{'status-file'}
- || printf STDERR "Cannot open status-file: $opts{'status-file'}\nWill not write status information!\n";
+ if ($opts{'status-file'} && ! $opts{'dry-run'}) {
+ if (! open($STATUS_FH, '>>', $opts{'status-file'})) {
+ print_error("cannot open status file >>$opts{'status-file'}: $!\n");
+ print_error("not writing status information!\n");
+ }
}
+ # get the config/var trees we will use.
($texmfconfig, $texmfvar)
= TeXLive::TLUtils::setup_sys_user_mode($prg, \%opts,
$TEXMFCONFIG, $TEXMFSYSCONFIG, $TEXMFVAR, $TEXMFSYSVAR);
+
+ # if we are using the sys tree, we don't want to give the usermode warning.
+ if ($texmfvar eq $TEXMFSYSVAR) {
+ $first_time_usermode_warning = 0;
+ }
determine_config_files("fmtutil.cnf");
my $changes_config_file = $alldata->{'changes_config'};
@@ -338,7 +347,8 @@ sub main {
}
if ($STATUS_FH) {
- close($STATUS_FH) || print STDERR "Cannot close fh for $opts{'status-file'}.\n";
+ close($STATUS_FH)
+ || print_error("cannot close $opts{'status-file'}: $!\n");
}
unless ($opts{'nohash'}) {
@@ -517,7 +527,8 @@ sub callback_build_formats {
# In case of user mode and formats rebuilt, warn that these formats
# will shadow future updates. Can be suppressed with --quiet which
# does not show print_info output
- if ($opts{'user'} && $suc && $first_time_creation_in_usermode) {
+ if ($opts{'user'} && $suc && $first_time_creation_in_usermode
+ && $first_time_usermode_warning) {
print_info("
*************************************************************
* *