summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tlpdbcheck
blob: bbc5b4bc81445b15f4a402eab7f2e9fe689acea9 (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
#!/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 tlpdb contains all the files in the trees, exactly once.

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

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

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

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

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

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

comm -3 $tlpdbfiles $diskfiles