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

commits+preining at tug.org commits+preining at tug.org
Thu Apr 22 02:51:46 CEST 2021


Revision: 58958
          http://tug.org/svn/texlive?view=revision&revision=58958
Author:   preining
Date:     2021-04-22 02:51:46 +0200 (Thu, 22 Apr 2021)
Log Message:
-----------
fmtutil: warn on first time user format dump

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-04-22 00:45:39 UTC (rev 58957)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl	2021-04-22 00:51:46 UTC (rev 58958)
@@ -60,6 +60,8 @@
 my @deferred_stderr;
 my @deferred_stdout;
 
+my $first_time_creation_in_usermode = 0;
+
 my $DRYRUN = "";
 my $STATUS_FH;
 
@@ -493,7 +495,35 @@
     # try to remove the tmpdir with all files
     TeXLive::TLUtils::rmtree($tmpdir);
   }
-   # return 
+  #
+  # 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) {
+    print_info("
+*************************************************************
+*                                                           *
+* WARNING: you are switching to fmtutil's per-user formats. *
+*            Please read the following explanations.        *
+*                                                           *
+*************************************************************
+
+You have run fmtutil-user (as opposed to fmtutil-sys) for the first time; this
+has created format files which are local to your personal account.
+
+Any changes in system formats will *not* be automatically reflected in
+your files; furthermore, running fmtutil-sys will no longer have any
+effect for you.  As a consequence, you have to rerun fmtutil-user yourself
+after any change in the system directories.
+
+See http://tug.org/texlive/scripts-sys-user.html for details.
+
+If you want to undo this, remove the files mentioned above.
+
+(Run $prg --help for full documentation of fmtutil.)
+");
+  }
+  # return 
   return $opts{"strict"} ? $err : 0;
 }
 
@@ -786,8 +816,13 @@
   }
 
   my $destfile = "$destdir/$fmtfile";
+  # set flag to warn that new user format was installed
+  # we check whether the next command **would** create a new file,
+  # and if it succeeded, we set the actual flag.
+  my $possibly_warn = ($opts{'user'} && ! -r $destfile);
   if (File::Copy::copy($fmtfile, $destfile )) {
     print_info("$destfile installed.\n");
+    $first_time_creation_in_usermode = $possibly_warn;
     #
     # original fmtutil.sh did some magic trick for mplib-luatex.mem
     #



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