freebsd-dev/usr.sbin/xntpd/scripts/mkversion

34 lines
523 B
Plaintext
Raw Normal View History

1993-12-21 18:36:48 +00:00
#!/bin/sh -
PROG=${1-UNKNOWN}
if [ ! -f .version ]; then
echo 0 > .version
fi
RUN="`cat .version`"
RUN="`expr $RUN + 1`"
echo $RUN > .version
DATE="`date`"
if [ -r VERSION ]; then
VERSION=VERSION
else
VERSION=../VERSION
fi
if [ -f "$VERSION" ]; then
FLAGS="`egrep '^[0-9a-zA-Z_]+=' "$VERSION" | tr '\012' ';'` "
else
FLAGS=""
fi
echo "Version $PROG ${FLAGS}${DATE} (${RUN})";
rm -f version.c
cat > version.c << -EoF-
/*
* version file for $PROG
*/
char * Version = "$PROG ${FLAGS}${DATE} (${RUN})";
-EoF-