summaryrefslogtreecommitdiffstats
path: root/bin/chkmanifest
blob: a166fe7b129ad780d5f5d1a144b0b8f8900accc1 (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

# Check that all the files in MANIFEST exist and that (if this is a
# CVS checkout) that all the CVS-managed files appear in the
# MANIFEST.

verbose=yes
MANIFEST=/tmp/H5_MANIFEST.$$

# Copy the manifest file to get a list of file names.
grep '^\.' MANIFEST | expand | cut -f1 -d' ' >$MANIFEST

test "$verbose" && echo "   Checking manifest..." 1>&2
test -f $MANIFEST || exit 1
for file in `cat $MANIFEST`; do
    if [ ! -f $file ]; then
       echo "- $file"
       fail=yes
    fi
done
for cvs in `find . -type d -name CVS -print`; do
    path=`echo $cvs |sed 's/\/CVS//'`
    for file in `grep '^\/' $cvs/Entries |cut -d/ -f2`; do
	if (grep $path/$file $MANIFEST >/dev/null); then
	    :
	else
	    echo "+ $path/$file"
	    fail=yes
	fi
    done
done

if [ "X$fail" = "Xyes" ]; then
    cat 1>&2 <<EOF
The MANIFEST is out of date. Files marked with a minus sign (-) no
longer exist; files marked with a plus sign (+) are CVS-managed but do
not appear in the MANIFEST.  Please remedy the situation and try again.
EOF
    exit 1
fi

exit 0