forked from epasveer/seer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchange_versionnumber
executable file
·65 lines (49 loc) · 1.38 KB
/
change_versionnumber
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh -f
#
# Beginning of a script to set the Seer version number.
# Need to update 3 files.
#
# Run from this 'script' directory.
#
# % cat ../src/CMakeLists.txt | sed 's/^project(seergdb VERSION \b\S\+\b/project(seergdb VERSION x.x/g'
# % cat ../src/SeerUtl.cpp | sed 's/SEER_VERSION \"\b\S\+\b\"/SEER_VERSION "x.x"/g'
# % cat ../debian/changelog | sed 's/^seergdb (\b\S\+\b)/seergdb (x.x)/g'
# % vim ../CHANGELOG.md
VERSION=""
usage() {
echo "usage: $0 -v VERSION" 1>&2
}
exit_abnormal() {
usage
exit 1
}
while getopts "hv:" options; do
case "${options}" in
h)
exit_abnormal
;;
v)
VERSION=${OPTARG}
;;
:)
echo "Error: -${OPTARG} requires an argument."
exit 1
;;
*)
exit_abnormal
;;
esac
done
if [ "$VERSION" = "" ]; then
exit_abnormal
fi
VERSION_CMAKE="`echo $VERSION | sed -e s/beta/0/g`"
echo "Changing Seer files to version ${VERSION}."
echo "../debian/changelog"
sed -i "s/^seergdb (\b\S\+\b)/seergdb ($VERSION)/g" ../debian/changelog
echo "../src/SeerUtl.cpp"
sed -i "s/SEER_VERSION \"\b\S\+\b\"/SEER_VERSION \"$VERSION\"/g" ../src/SeerUtl.cpp
echo "../src/CMakeLists.txt"
sed -i "s/^project(seergdb VERSION \b\S\+\b/project(seergdb VERSION $VERSION_CMAKE/g" ../src/CMakeLists.txt
echo "Done."
exit 0