summaryrefslogtreecommitdiff
path: root/Master/Tools/update-lsr
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Tools/update-lsr')
-rwxr-xr-xMaster/Tools/update-lsr42
1 files changed, 42 insertions, 0 deletions
diff --git a/Master/Tools/update-lsr b/Master/Tools/update-lsr
new file mode 100755
index 00000000000..6e85c9bc101
--- /dev/null
+++ b/Master/Tools/update-lsr
@@ -0,0 +1,42 @@
+#!/bin/sh
+# $Id: //depot/Master/Tools/update-lsr#1 $ $Date: 2005/06/28 $ $Author: karl $
+# Originally written 2004, Karl Berry. Public domain.
+#
+# Update ls-R files. Called from tlrebuild and also karl's cron.
+
+mydir=`dirname $0`
+tools=`cd $mydir && pwd`
+PATH=$tools:$PATH; export PATH
+umask 0
+
+master=`cd $mydir/.. && pwd`
+
+# save current.
+cd $master || exit 1
+for f in texmf*/ls-R; do
+ rm -f $f.save
+ cp $f $f.save
+done
+#
+# generate new.
+p4 edit texmf*/ls-R
+./bin/i386-linux/mktexlsr
+#
+for f in texmf*/ls-R; do
+ test $f = texmf-var/ls-R && continue # not checked in
+ if cmp -s $f.save $f; then
+ # no change, back to current.
+ p4 revert $f
+ else
+ : # update needed, will happen next.
+ fi
+ #
+ rm -f $f.save
+done
+
+# if we have any files, submit to perforce (frightening but necessary).
+if p4 change -o | grep '^Files:' >/dev/null; then
+ p4 change -o \
+ | sed "s!<enter description here>!regenerated by $0!" \
+ | p4 submit -i
+fi