texlive[53274] Master/tlpkg/bin: check for broken symlinks under

commits+karl at tug.org commits+karl at tug.org
Tue Dec 31 00:43:21 CET 2019


Revision: 53274
          http://tug.org/svn/texlive?view=revision&revision=53274
Author:   karl
Date:     2019-12-31 00:43:21 +0100 (Tue, 31 Dec 2019)
Log Message:
-----------
check for broken symlinks under bin/, both source tree and after test installation

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tl-update-tlnet

Added Paths:
-----------
    trunk/Master/tlpkg/bin/tl-check-symlinks

Added: trunk/Master/tlpkg/bin/tl-check-symlinks
===================================================================
--- trunk/Master/tlpkg/bin/tl-check-symlinks	                        (rev 0)
+++ trunk/Master/tlpkg/bin/tl-check-symlinks	2019-12-30 23:43:21 UTC (rev 53274)
@@ -0,0 +1,30 @@
+#!/usr/bin/env perl
+# $Id$
+# Check given directory tree(s) (default to .) for broken symlinks;
+# report any found, and exit accordingly.
+
+use strict;
+use warnings;
+use File::Find;
+
+our $fail = 0;
+$ARGV[0] = "." if ! @ARGV;
+find(\&process_file, @ARGV);
+exit $fail;
+
+# $File::Find::dir is the current directory name,
+# $_ is the current filename within that directory
+# $File::Find::name is the complete pathname to the file.
+#
+sub process_file {
+  return unless -l;
+  return if -r;
+  $fail = 1;
+  print "broken link $File::Find::name -> ", readlink($_), "\n";
+}
+
+# Doesn't get to the warning in Find.pm, dunno. Anyway, our warning is
+# better since it includes the target.
+#!/bin/sh
+# exec perl -w -MFile::Find -e 'my $wanted=sub{};
+#   find({wanted=>$wanted, dangling_symlinks=>1}, "/home/karl/bin");'


Property changes on: trunk/Master/tlpkg/bin/tl-check-symlinks
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tl-update-tlnet
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlnet	2019-12-30 23:20:26 UTC (rev 53273)
+++ trunk/Master/tlpkg/bin/tl-update-tlnet	2019-12-30 23:43:21 UTC (rev 53274)
@@ -42,7 +42,7 @@
   --help)              echo "ustl. sorry."; exit 0;;
   --version)           echo "$vc_id"; exit 0;;
   *) echo "$0: unrecognized option \`$1'; see source." >&2
-      exit 1;;
+     exit 1;;
   esac
   shift
 done
@@ -66,6 +66,11 @@
   Master=`cd $mydir/../.. && pwd`
 fi
 
+# If there are broken symlinks anywhere in the bin directories, give up
+# right away. The nightly cron checks that there no symlinks anywhere else.
+# Below, we check for broken symlinks in the bin/ dir as installed.
+$Master/tlpkg/bin/tl-check-symlinks $Master/bin
+
 # Keep the default out of ~ftp/texlive, which CTAN mirrors much of
 test -z "$tltrybase" \
 && tltrybase=`cd $tlweb/../.. && pwd`/tlnet-trial-`date +%y%m%d`
@@ -205,7 +210,7 @@
   $ignore_unexpected_output || failure=true
   echo >&2
   echo "$0: Test installation failed." >&2
-  echo "$0: Here is the unexpected output from $tlnet_install_log:" >&2
+  echo "$0: Here is the unexpected output, from $tlnet_install_log:" >&2
   echo "$unexpected_output" >&2
   echo "$0: (end of unexpected output)." >&2
 fi
@@ -215,6 +220,8 @@
   for cmd in \
    "$tltryinst/$yyyy/bin/*/tlmgr --repository $tltry update --list" \
    "$tltryinst/$yyyy/bin/*/updmap-sys -n" \
+   "$tltryinst/$yyyy/bin/*/mktexlsr -n --verbose" \
+   "$Master/tlpkg/bin/tl-check-symlinks $tltryinst/$yyyy/bin" \
    "$Master/tlpkg/bin/tl-check-tlnet-consistency --location=$tltry" \
    "$Master/tlpkg/bin/tl-compare-tlpdbs $critical $tltry/tlpkg/texlive.tlpdb" \
   ; do
@@ -252,32 +259,37 @@
 cp -f $tlnet_install_log /tmp
 test ! -r $install_tl_log || cp -f $install_tl_log /tmp
 
-if $failure; then
+if $failure || $chicken; then
   echo >&2
   echo "$0: Our transcript file: $tlnet_install_log" >&2
   echo "$0: install-tl log file: $install_tl_log" >&2
   echo "$0: Copies of both are in /tmp." >&2
   echo "$0: Please rm -rf the trial dir." >&2
-  exit 1
+  if $failure; then
+    exit 1
+  elif $chicken; then
+    echo
+    echo "$0: Chicken mode, not updating anything."
+    exit 0
+  else
+    echo "$0: impossible non-failure non-chicken." >&2
+    exit 2
+  fi
 fi
 
 # 

 # no unexpected output, so ship the new packages.
 cd $tltrybase
-if $chicken; then
-  echo "$0: Chicken mode, not updating anything."
-else
-  echo "$0: Updating $tlweb from $tltry."
-  # copy any mactex files since we didn't link them.
-  for f in $tlweb/*mactex*; do
-    test ! -r $f || cp -pf $f $tltry
-  done
-  
-  # mv then rm to avoid the mirmon probe from making the rm fail.
-  mv $tlweb $tltrybase/tlnet.old
-  mv $tltry $tlweb
-  rm -rf $tltrybase
-  echo "$0: Done."
-fi
+echo "$0: Updating $tlweb from $tltry."
+# copy any mactex files since we didn't link them.
+for f in $tlweb/*mactex*; do
+  test ! -r $f || cp -pf $f $tltry
+done
 
+# mv then rm to avoid the mirmon probe from making the rm fail.
+mv $tlweb $tltrybase/tlnet.old
+mv $tltry $tlweb
+rm -rf $tltrybase
+echo "$0: Done."
+
 exit 0



More information about the tex-live-commits mailing list