blob: 66603e6d20410ccead681c8741d2084ca04af1e4 (
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
|
#/bin/sh
#
# This script defines some helper functions used by other scripts in the docs
# folder.
get_short_revision_number()
{
RESULT=`hg log -r $1 | grep changeset | awk '{print $2}' | sed -e 's/:.*//'`
}
get_last_modified_date()
{
RESULT=`hg log $1 -l1 --template '{date|date}\n' | awk '{ print $2" "$3", " $5}'`
}
get_dlib_version()
{
cat ../dlib/CMakeLists.txt | awk '/set\(CPACK_PACKAGE_VERSION_'$1'/{ match($2,"\"(.*)\"",a); print a[1]}'
}
# call like: set_dlib_version MAJOR 42
set_dlib_version()
{
sed -i -e 's/\(set(CPACK_PACKAGE_VERSION_'$1' *"\).*\(".*\)/\1'$2'\2/' ../dlib/CMakeLists.txt
}
MAJOR_NUM=`get_dlib_version MAJOR`
MINOR_NUM=`get_dlib_version MINOR`
PATCH_NUM=`get_dlib_version PATCH`
|