summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tldbcheck
blob: 64a6c290b57e95f6792216866044d9c18fb1918c (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
#!/bin/sh
# $Id$
# Copyright 2007 Karl Berry
# This file is licensed under the GNU General Public Licence version 2
# or any later version.
# 
# Check that tldb contains all the files in the trees, exactly once.

cd `dirname $0`/../.. || exit 1

if test ! -s texlive.tldb; then
  echo "$0: no (nonempty) texlive.tldb in $0, goodbye." >&2
  exit 1
fi

: ${TMPDIR=/tmp}
trap "rm -f $TMPDIR/tldb*" 0 1 2 15

# Get list of files.
tldbfiles=$TMPDIR/tldbfiles.$$
grep '^ ' texlive.tldb | sort >$tldbfiles

echo "$0: checking duplicates..."
# GNU uniq makes it simple.
uniq --repeated $tldbfiles

echo "$0: checking coverage...(long)"
dirs=bin
diskfiles=$TMPDIR/tldbdisk.$$
find $dirs -name .svn -prune -o \( \( -type f -o -type l \) -print \) | sed 's/^/ /' | sort | tee /tmp/x >$diskfiles

comm -3 $tldbfiles $diskfiles