blob: 1563c77879441ce89b73474cdbbf9ae83e187714 (
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
43
44
45
46
|
#!/bin/bash
SCRIPTPATH="$(cd "$(dirname "$0")"; pwd -P)"
RELEASE="$(cd ${SCRIPTPATH}; cat ../configure.ac|grep C_INIT|cut -c 20-|rev|cut -c 3-|rev)"
MAJOR_RELEASE="$(cd ${SCRIPTPATH}; cat ../configure.ac|grep C_INIT|cut -c 20-|rev|cut -c 3-|rev|cut -d. -f1)"
REVISION="$(cd ${SCRIPTPATH}; git rev-list --all |wc -l | tr -d '[[:space:]]')"
get_release() {
echo "${RELEASE}"
exit 0
}
get_major_release() {
echo "${MAJOR_RELEASE}"
exit 0
}
get_revision() {
echo "${REVISION}"
exit 0
}
get_version() {
echo "${RELEASE}-${REVISION}"
exit 0
}
case "$1" in
--release)
get_release;
;;
--major-release)
get_major_release;
;;
--revision)
get_revision;
;;
--version)
get_version;
;;
*)
echo "Usage: ${0} {--release|--major-release|--revision|--version}"
exit 1
esac
exit 0
|