texlive[60154] Master/texmf-dist/scripts/texlive/fmtutil.pl:

commits+karl at tug.org commits+karl at tug.org
Tue Aug 3 23:55:57 CEST 2021


Revision: 60154
          http://tug.org/svn/texlive?view=revision&revision=60154
Author:   karl
Date:     2021-08-03 23:55:56 +0200 (Tue, 03 Aug 2021)
Log Message:
-----------
($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.

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2021-08-03 21:09:49 UTC (rev 60153)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2021-08-03 21:55:56 UTC (rev 60154)
@@ -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 @@
 # $::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 @@
 
   $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 @@
   }
 
   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 @@
   # 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("
 *************************************************************
 *                                                           *



More information about the tex-live-commits mailing list.