summaryrefslogtreecommitdiff
path: root/Master/Tools/update-lsr
blob: 6e85c9bc101072224e8c8f0fed296a45a3a31947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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