Annotation of embedaddon/ntp/scripts/genver, revision 1.1.1.1
1.1 misho 1: #! /bin/sh
2:
3: # possible usage: $0 [-f] [version.m4] [version.def]
4: #
5: # -f would be 'force the update'
6:
7: force=0
8: outputs=
9: for i in $*
10: do
11: case "$i" in
12: -f) force=1 ;;
13: version.m4)
14: outputs="version.m4 $outputs"
15: ;;
16: *version.def)
17: outputs="include/version.def $outputs"
18: ;;
19: *version.texi)
20: outputs="include/version.texi $outputs"
21: ;;
22: *) echo "Unrecognized option: $i"
23: exit 1
24: ;;
25: esac
26: done
27:
28: case "$outputs" in
29: '') outputs="version.m4 include/version.def include/version.texi" ;;
30: esac
31:
32: set -e
33:
34: . ./packageinfo.sh
35:
36: dversion=`scripts/VersionName`
37:
38: set +e
39:
40: case "$outputs" in
41: *version.m4*)
42: echo "m4_define([VERSION_NUMBER],[${dversion}])" > /tmp/version.m4+
43: cmp -s /tmp/version.m4+ version.m4
44: rc=$?
45: case "$force$rc" in
46: 00)
47: rm -f /tmp/version.m4+
48: ;;
49: *)
50: mv /tmp/version.m4+ version.m4
51: ;;
52: esac
53: ;;
54: esac
55:
56: case "$outputs" in
57: *version.def*)
58: echo "version = '${dversion}';" > /tmp/version.def+
59: cmp -s /tmp/version.def+ include/version.def
60: rc=$?
61: case "$force$rc" in
62: 00)
63: rm -f /tmp/version.def+
64: ;;
65: *)
66: mv /tmp/version.def+ include/version.def
67: ;;
68: esac
69: ;;
70: esac
71:
72: case "$outputs" in
73: *version.texi*)
74: echo "@set UPDATED `date +'%d %B %Y'`" > /tmp/version.texi+
75: echo "@set EDITION $dversion" >> /tmp/version.texi+
76: echo "@set VERSION $dversion" >> /tmp/version.texi+
77: cmp -s /tmp/version.texi+ include/version.texi
78: rc=$?
79: case "$force$rc" in
80: 00)
81: rm -f /tmp/version.texi+
82: ;;
83: *)
84: mv /tmp/version.texi+ include/version.texi
85: ;;
86: esac
87: ;;
88: esac
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>