texlive[53231] trunk: doc,sync

commits+karl at tug.org commits+karl at tug.org
Wed Dec 25 23:50:12 CET 2019


Revision: 53231
          http://tug.org/svn/texlive?view=revision&revision=53231
Author:   karl
Date:     2019-12-25 23:50:12 +0100 (Wed, 25 Dec 2019)
Log Message:
-----------
doc,sync

Modified Paths:
--------------
    trunk/Build/source/texk/tests/TeXLive/TLUtils.pm
    trunk/Build/source/texk/texlive/w32_wrapper/runscript.tlu
    trunk/Master/texmf-dist/scripts/texlive/NEWS
    trunk/Master/texmf-dist/web2c/texmf.cnf

Modified: trunk/Build/source/texk/tests/TeXLive/TLUtils.pm
===================================================================
--- trunk/Build/source/texk/tests/TeXLive/TLUtils.pm	2019-12-25 22:48:02 UTC (rev 53230)
+++ trunk/Build/source/texk/tests/TeXLive/TLUtils.pm	2019-12-25 22:50:12 UTC (rev 53231)
@@ -5,7 +5,7 @@
 
 package TeXLive::TLUtils;
 
-my $svnrev = '$Revision: 53076 $';
+my $svnrev = '$Revision: 53225 $';
 my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
 sub module_revision { return $_modulerevision; }
 
@@ -88,6 +88,7 @@
   TeXLive::TLUtils::log($str1, ...);     # only to log file
   TeXLive::TLUtils::tlwarn($str1, ...);  # warn on stderr and log
   TeXLive::TLUtils::tldie($str1, ...);   # tlwarn and die
+  TeXLive::TLUtils::debug_hash_str($label, HASH); # stringified HASH
   TeXLive::TLUtils::debug_hash($label, HASH);   # warn stringified HASH
   TeXLive::TLUtils::backtrace();                # return call stack as string
   TeXLive::TLUtils::process_logging_options($texdir); # handle -q -v* -logfile
@@ -215,7 +216,8 @@
     &SshURIRegex
   );
   @EXPORT = qw(setup_programs download_file process_logging_options
-               tldie tlwarn info log debug ddebug dddebug debug_hash
+               tldie tlwarn info log debug ddebug dddebug debug
+               debug_hash_str debug_hash
                win32 xchdir xsystem run_cmd system_pipe sort_archs);
 }
 
@@ -830,7 +832,7 @@
 
 Tests whether its argument is writable by trying to write to
 it. This function is necessary because the built-in C<-w> test just
-looks at mode and uid/guid, which on Windows always returns true and
+looks at mode and uid/gid, which on Windows always returns true and
 even on Unix is not always good enough for directories mounted from
 a fileserver.
 
@@ -1317,6 +1319,7 @@
 
       my $item = "$d/$dirent";  # prepend directory for comparison
       if (! exists $seen{$item}) {
+        ddebug("   no collapse of $d because of: $dirent\n");
         $ok_to_collapse = 0;
         last;  # no need to keep looking after the first.
       }
@@ -1333,21 +1336,25 @@
 
 =item C<removed_dirs(@files)>
 
-returns all the directories from which all content will be removed
+Returns all the directories from which all content will be removed.
 
+Here is the idea:
+
+=over 4
+
+=item create a hashes by_dir listing all files that should be removed
+   by directory, i.e., key = dir, value is list of files
+
+=item for each of the dirs (keys of by_dir and ordered deepest first)
+   check that all actually contained files are removed
+   and all the contained dirs are in the removal list. If this is the
+   case put that directory into the removal list
+
+=item return this removal list
+
+=back
 =cut
 
-# return all the directories from which all content will be removed
-#
-# idea:
-# - create a hashes by_dir listing all files that should be removed
-#   by directory, i.e., key = dir, value is list of files
-# - for each of the dirs (keys of by_dir and ordered deepest first)
-#   check that all actually contained files are removed
-#   and all the contained dirs are in the removal list. If this is the
-#   case put that directory into the removal list
-# - return this removal list
-#
 sub removed_dirs {
   my (@files) = @_;
   my %removed_dirs;
@@ -2557,10 +2564,10 @@
 sub setup_system_one {
   my ($p, $arg) = @_;
   my $nulldev = nulldev();
-  debug("trying to set up system $p, arg $arg\n");
+  ddebug("trying to set up system $p, arg $arg\n");
   my $ret = system("$p $arg >$nulldev 2>&1");
   if ($ret == 0) {
-    debug("program $p found in the path\n");
+    debug("program $p found in path\n");
     $::progs{$p} = $p;
     return(1);
   } else {
@@ -3288,6 +3295,8 @@
 
 Logging and debugging messages.
 
+=over 4
+
 =item C<logit($out,$level, at rest)>
 
 Internal routine to write message to both C<$out> (references to
@@ -3461,14 +3470,19 @@
   }
 }
 
-=item C<debug_hash ($label, HASH)>
+=item C<debug_hash_str($label, HASH)>
 
-Write LABEL followed by HASH elements, all on one line, to stderr.
-If HASH is a reference, it is followed.
+Return LABEL followed by HASH elements, followed by a newline, as a
+single string. If HASH is a reference, it is followed (but no recursive
+derefencing).
 
+=item C<debug_hash($label, HASH)>
+
+Write the result of C<debug_hash_str> to stderr.
+
 =cut
 
-sub debug_hash {
+sub debug_hash_str {
   my ($label) = shift;
   my (%hash) = (ref $_[0] && $_[0] =~ /.*HASH.*/) ? %{$_[0]} : @_;
 
@@ -3484,9 +3498,13 @@
   $str .= join (",", @items);
   $str .= "}";
 
-  warn "$str\n";
+  return "$str\n";
 }
 
+sub debug_hash {
+  warn &debug_hash_str(@_);
+}
+
 =item C<backtrace()>
 
 Return call(er) stack, as a string.
@@ -3611,8 +3629,9 @@
 
 =item C<push_uniq(\@list, @new_items)>
 
-The C<push_uniq> function pushes the last argument @ITEMS to the $LIST
-referenced by the first argument, if they are not already in the list.
+The C<push_uniq> function pushes each element in the last argument
+ at ITEMS to the $LIST referenced by the first argument, if it is not
+already in the list.
 
 =cut
 
@@ -3619,7 +3638,11 @@
 sub push_uniq {
   my ($l, @new_items) = @_;
   for my $e (@new_items) {
-    if (! &member($e, @$l)) {
+   # turns out this is one of the most-used functions when updating the
+   # tlpdb, with hundreds of thousands of calls. So let's write it out
+   # to eliminate the sub overhead.
+   #if (! &member($e, @$l)) {
+    if (! scalar grep($_ eq $e, @$l)) {
       push (@$l, $e);
     }
   }
@@ -3656,38 +3679,67 @@
 
 =item C<texdir_check($texdir)>
 
-Test whether installation with TEXDIR set to $texdir would succeed due to
-writing permissions.
+Test whether installation with TEXDIR set to $texdir should be ok, e.g.,
+would be a creatable directory. Return 1 if ok, 0 if not.
 
 Writable or not, we will not allow installation to the root
 directory (Unix) or the root of a drive (Windows).
 
+We also do not allow paths containing various special characters, and
+print a message about this if second argument WARN is true. (We only
+want to do this for the regular text installer, since spewing output in
+a GUI program wouldn't be good; the generic message will have to do for
+them.)
+
 =cut
 
 sub texdir_check {
-  my $texdir = shift;
-  return 0 unless defined $texdir;
+  my ($orig_texdir,$warn) = @_;
+  return 0 unless defined $orig_texdir;
+
   # convert to absolute, for safer parsing.
+  # also replaces backslashes with slashes on w32.
   # The return value may still contain symlinks,
   # but no unnecessary terminating '/'.
-  $texdir = tl_abs_path($texdir);
+  my $texdir = tl_abs_path($orig_texdir);
   return 0 unless defined $texdir;
-  # also reject the root of a drive,
+
+  # reject the root of a drive,
   # assuming that only the canonical form of the root ends with /
   return 0 if $texdir =~ m!/$!;
-  # win32: for now, reject the root of a samba share
+
+  # Unfortunately we have lots of special characters.
+  # On Windows, backslashes are normal but will already have been changed
+  # to slashes by tl_abs_path. And we should only check for : on Unix.
+  my $colon = win32() ? "" : ":";
+  if ($texdir =~ /[,$colon;\\{}\$]/) {
+    if ($warn) {
+      print "     !! TEXDIR value has problematic characters: $orig_texdir\n";
+      print "     !! (such as comma, colon, semicolon, backslash, braces\n";
+      print "     !!  and dollar sign; sorry)\n";
+    }
+    # although we could check each character individually and give a
+    # specific error, it seems plausibly useful to report all the chars
+    # that cause problems, regardless of which was there. Simpler too.
+    return 0;
+  }
+  # w32: for now, reject the root of a samba share
   return 0 if win32() && $texdir =~ m!^//[^/]+/[^/]+$!;
-  my $texdirparent;
-  my $texdirpparent;
 
+  # if texdir already exists, make sure we can write into it.
   return dir_writable($texdir) if (-d $texdir);
-  ($texdirparent = $texdir) =~ s!/[^/]*$!!;
+
+  # if texdir doesn't exist, make sure we can write the parent.
+  (my $texdirparent = $texdir) =~ s!/[^/]*$!!;
   #print STDERR "Checking $texdirparent".'[/]'."\n";
-  return  dir_creatable($texdirparent) if -d dir_slash($texdirparent);
-  # try another level up the tree
-  ($texdirpparent = $texdirparent) =~ s!/[^/]*$!!;
+  return dir_creatable($texdirparent) if -d dir_slash($texdirparent);
+  
+  # ditto for the next level up the tree
+  (my $texdirpparent = $texdirparent) =~ s!/[^/]*$!!;
   #print STDERR "Checking $texdirpparent".'[/]'."\n";
   return dir_creatable($texdirpparent) if -d dir_slash($texdirpparent);
+  
+  # doesn't look plausible.
   return 0;
 }
 
@@ -4657,12 +4709,8 @@
   my $ret = "[" . join(",", map { encode_json(\$_) } @$hr) . "]";
   return($ret);
 }
-
-
-
 =back
 =cut
-
 1;
 __END__
 

Modified: trunk/Build/source/texk/texlive/w32_wrapper/runscript.tlu
===================================================================
--- trunk/Build/source/texk/texlive/w32_wrapper/runscript.tlu	2019-12-25 22:48:02 UTC (rev 53230)
+++ trunk/Build/source/texk/texlive/w32_wrapper/runscript.tlu	2019-12-25 22:50:12 UTC (rev 53231)
@@ -1,7 +1,7 @@
 
 
-local svnrevision = string.match("$Revision: 51942 $", "%d+") or "0"
-local svndate     = string.match("$Date: 2019-08-23 15:13:14 +0200 (Fri, 23 Aug 2019) $", "[-%d]+") or "2009-12-04"
+local svnrevision = string.match("$Revision: 53144 $", "%d+") or "0"
+local svndate     = string.match("$Date: 2019-12-16 14:40:08 +0100 (Mon, 16 Dec 2019) $", "[-%d]+") or "2009-12-04"
 local bannerstr   = "runscript wrapper utility (rev. " ..
                     svnrevision .. ", " .. svndate .. ")\n" .. 
                     "usage:   runscript script-name [arguments]\n" ..
@@ -281,8 +281,6 @@
 -- HELPER SUBROUTINES --
 
 local TEXDIR
-local TEXDIRBSL
-local TEXMFDISTBSL
 local guimode
 
 local function show_error(msg)
@@ -708,14 +706,12 @@
   end
 else
   -- use built in gs
-   TEXDIRBSL = string.gsub(TEXDIR,'/', '\\')
-   TEXMFDISTBSL = string.gsub(TEXMFDIST,'/', '\\')
-   os.setenv('GS_LIB', TEXDIRBSL..'\\tlpkg\\tlgs\\lib;'
-	     ..TEXDIRBSL..'\\tlpkg\\tlgs\\fonts;'
-	     ..TEXDIRBSL..'\\tlpkg\\tlgs\\Resource\\Init;'
-	     ..TEXDIRBSL..'\\tlpkg\\tlgs\\Resource;'
-	     ..TEXDIRBSL..'\\tlpkg\\tlgs\\kanji;'
-	     ..os.getenv('WINDIR')..'\\Fonts;'..TEXMFDISTBSL..'\\fonts')
+   os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'
+	     ..TEXDIR..'/tlpkg/tlgs/fonts;'
+	     ..TEXDIR..'/tlpkg/tlgs/Resource/Init;'
+	     ..TEXDIR..'/tlpkg/tlgs/Resource;'
+	     ..TEXDIR..'/tlpkg/tlgs/kanji;'
+	     ..os.getenv('WINDIR')..'/Fonts;'..TEXMFDIST..'/fonts')
   os.setenv('GS_DLL', TEXDIR..'/tlpkg/tlgs/bin/gsdll32.dll')
   GSEXE = TEXDIR..'/tlpkg/tlgs/bin/gswin32c.exe'
   GSNAME = 'gswin32c.exe'

Modified: trunk/Master/texmf-dist/scripts/texlive/NEWS
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/NEWS	2019-12-25 22:48:02 UTC (rev 53230)
+++ trunk/Master/texmf-dist/scripts/texlive/NEWS	2019-12-25 22:50:12 UTC (rev 53231)
@@ -1,6 +1,13 @@
 (This file public domain.  Originally written by Norbert Preining and
 Karl Berry, 2010.)
 
+<p><b>tlmgr 53225 (released 25dec19):</b>
+<li>avoid doubled .rNNN in backup container names.
+<li>warning when chosen installation root (TEXDIR) has problematic characters.
+<li>silence check texmfdbs by default; refine checks.
+<li>omit catalogue-date entry when packages are updated.
+<li>debugging output when a directory is failed to be collapsed for backup tar.
+
 <p><b>tlmgr 52931 (released 27nov19):</b>
 <li>major change to <a
 href="https://tug.org/texlive/tlmgr.html#verpkg">versioned package

Modified: trunk/Master/texmf-dist/web2c/texmf.cnf
===================================================================
--- trunk/Master/texmf-dist/web2c/texmf.cnf	2019-12-25 22:48:02 UTC (rev 53230)
+++ trunk/Master/texmf-dist/web2c/texmf.cnf	2019-12-25 22:50:12 UTC (rev 53231)
@@ -858,13 +858,13 @@
 screen_depth.mf = 1200
 
 % BibTeX only (max_strings also determines hash_size and hash_prime).
-ent_str_size =  250
-glob_str_size = 20000
-max_strings.bibtex  = 100000
-max_strings.bibtex8 = 100000
-max_strings.bibtexu = 100000
-max_strings.pbibtex = 100000
-max_strings.upbibtex = 100000
+ent_str_size = 500
+glob_str_size = 200000
+max_strings.bibtex  = 200000
+max_strings.bibtex8 = 200000
+max_strings.bibtexu = 200000
+max_strings.pbibtex = 200000
+max_strings.upbibtex= 200000
 
 % GFtype only.
 line_length.gftype = 500



More information about the tex-live-commits mailing list