diff options
Diffstat (limited to 'usr.sbin/xntpd/scripts/mkversion')
-rwxr-xr-x | usr.sbin/xntpd/scripts/mkversion | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/usr.sbin/xntpd/scripts/mkversion b/usr.sbin/xntpd/scripts/mkversion new file mode 100755 index 0000000..07dbb77 --- /dev/null +++ b/usr.sbin/xntpd/scripts/mkversion @@ -0,0 +1,33 @@ +#!/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- |