texlive[52045] Master/texmf-dist/scripts/texlive/tlmgr.pl: tlmgr: add

commits+preining at tug.org commits+preining at tug.org
Sat Sep 7 07:32:40 CEST 2019


Revision: 52045
          http://tug.org/svn/texlive?view=revision&revision=52045
Author:   preining
Date:     2019-09-07 07:32:39 +0200 (Sat, 07 Sep 2019)
Log Message:
-----------
tlmgr: add check texmfdbs

1) all trees listed in $TEXMFDBS are specified with !! and have an ls-R, while
2) all trees in $TEXMF that are not in $TEXMFDBS
   do not have !! and do not have an ls-R.

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

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2019-09-06 23:53:33 UTC (rev 52044)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2019-09-07 05:32:39 UTC (rev 52045)
@@ -5340,6 +5340,8 @@
     $ret |= check_executes();
     print "Running check runfiles:\n";
     $ret |= check_runfiles();
+    print "Running check texmfdb paths\n";
+    $ret |= check_texmfdbs();
   } elsif ($what =~ m/^files/i) {
     my $tltree = init_tltree($svn);
     $ret |= check_files($tltree);
@@ -5352,6 +5354,8 @@
     $ret |= check_runfiles();
   } elsif ($what =~ m/^executes/i) {
     $ret |= check_executes();
+  } elsif ($what =~ m/^texmfdbs/i) {
+    $ret |= check_texmfdbs();
   } else {
     print "No idea how to check that: $what\n";
   }
@@ -5842,7 +5846,50 @@
   return $ret;
 }
 
+sub check_texmfdbs {
 
+#!/usr/bin/perl
+  my $texmfdbs = `kpsewhich -var-value TEXMFDBS`;
+  my @tfmdbs = glob $texmfdbs;
+  my $tfms = `kpsewhich -var-value TEXMF`;
+  my @tfms = glob $tfms;
+  my %tfmdbs;
+  my $ret = 0;
+
+  print "Checking TEXMFDBS\n";
+  for my $p (@tfmdbs) {
+    print "-> $p\n";
+    if ($p !~ m/^!!/) {
+      printf "Warn: entry $p in TEXMFDBS does not have leading !!\n";
+      $ret++;
+    }
+    $p =~ s/^!!//;
+    $tfmdbs{$p} = 1;
+    if (! -r "$p/ls-R") {
+      printf "Warn: entry $p does not have an associated ls-R\n";
+      $ret++;
+    }
+  }
+
+  print "Checking TEXMF\n";
+  for my $p (@tfms) {
+    print "-> $p\n";
+    my $pnobang = $p;
+    $pnobang =~ s/^!!//;
+    if (! $tfmdbs{$pnobang}) {
+      if ($p =~ m/^!!/) {
+        printf "Warn: tree $p in TEXMF is not in TEXMFDBS but has !!\n";
+        $ret++;
+      }
+      if (-r "$pnobang/ls-R") {
+        printf "Warn: tree $p in TEXMF is not in TEXMFDBS but has ls-R file\n";
+        $ret++;
+      }
+    }
+  }
+  return($ret);
+}
+
 # 
 POSTACTION
 # 
 # explictly run the various post actions, e.g.,



More information about the tex-live-commits mailing list