| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# generates a fingerprint of the source code state in the form of an archive of CVS directories |
| 4 |
|
| 5 |
# set -x |
| 6 |
|
| 7 |
echo Generating CVS fingerprint... |
| 8 |
|
| 9 |
rm -rf fingerprint |
| 10 |
PD="`pwd`" |
| 11 |
cd ${top_srcdir}/.. |
| 12 |
rm -rf "$PD/fingerprint" |
| 13 |
mkdir "$PD/fingerprint" |
| 14 |
for f in *rmagetronad *rmagetronad_build* *rmagetronad_win* release; do |
| 15 |
if test -d $f; then |
| 16 |
mkdir "$PD/fingerprint/$f" |
| 17 |
find $f -type d -mindepth 1 ! -name "fingerprint" -exec mkdir "$PD/fingerprint/"\{\} \; > /dev/null 2>&1 |
| 18 |
find $f -name Entries -exec cp -r \{\} "$PD/fingerprint/"\{\} \; > /dev/null 2>&1 |
| 19 |
find $f -name Tag -exec cp -r \{\} "$PD/fingerprint/"\{\} \; > /dev/null 2>&1 |
| 20 |
find $f -name Repository -exec cp -r \{\} "$PD/fingerprint/"\{\} \; > /dev/null 2>&1 |
| 21 |
fi |
| 22 |
done |
| 23 |
cd "$PD" |
| 24 |
|
| 25 |
find fingerprint -depth -type d ! -name CVS -exec rmdir \{\} \; > /dev/null 2>&1 |
| 26 |
|
| 27 |
# copy regeneration script |
| 28 |
cp ${top_srcdir}/batch/make/regenerate_fingerprint fingerprint/regenerate.sh |
| 29 |
|
| 30 |
# see if all CVS directories contain the Tag file |
| 31 |
CVSDIRS=`find fingerprint -depth -type d -name CVS` |
| 32 |
TAG="" |
| 33 |
SAMETAG=true |
| 34 |
for f in $CVSDIRS; do |
| 35 |
if test -d $f; then |
| 36 |
if test -r "$f/Tag"; then |
| 37 |
THISTAG=`sed < "$f/Tag" -e 's,^N,,' -e 's,^T,,'` |
| 38 |
if test -z "$TAG" || test "$THISTAG" = "$TAG"; then |
| 39 |
TAG=$THISTAG |
| 40 |
else |
| 41 |
if test $SAMETAG = true; then |
| 42 |
echo $f has an unique tag, full fingerprint required |
| 43 |
fi |
| 44 |
SAMETAG=false |
| 45 |
fi |
| 46 |
else |
| 47 |
if test $SAMETAG = true; then |
| 48 |
echo $f has no tag, full fingerprint required |
| 49 |
fi |
| 50 |
SAMETAG=false |
| 51 |
fi |
| 52 |
fi |
| 53 |
done |
| 54 |
|
| 55 |
if echo $TAG | grep "^b" > /dev/null; then |
| 56 |
if test $SAMETAG = true; then |
| 57 |
echo $TAG is is only a branch tag, full fingerprint required |
| 58 |
fi |
| 59 |
SAMETAG=false |
| 60 |
fi |
| 61 |
|
| 62 |
if test $SAMETAG = true; then |
| 63 |
echo "This seems to be a tagged release, no fingerprint needed." |
| 64 |
cd fingerprint |
| 65 |
for f in *; do if test -d $f; then |
| 66 |
echo cvs co -r $TAG `cat $f/CVS/Repository`>> regenerate.sh |
| 67 |
rm -rf $f |
| 68 |
fi; done |
| 69 |
cd "$PD" |
| 70 |
fi |
| 71 |
|
| 72 |
chmod 755 fingerprint/regenerate.sh |
| 73 |
|
| 74 |
# compress everything |
| 75 |
tar -cjf fingerprint.tbz fingerprint |
| 76 |
rm -rf fingerprint |