Bug #1497 ยป Version.patch
support/version | ||
---|---|---|
8 | 8 | |
9 | 9 |
# Calculate version |
10 | 10 |
if [ -d ".git" ]; then |
11 |
VER=$(cd $(dirname $0); git describe --dirty --match "v*" 2> /dev/null | sed "s/^v//" | sed "s/-\([0-9]*\)-\(g[0-9a-f]*\)/.\1~\2/") |
|
11 |
VER=$(cd $(dirname $0); git describe --dirty --match "v*" 2> /dev/null) |
|
12 |
if [ $? -ne 0 ]; then |
|
13 |
# Git describe failed, maybe "--dirty" option is not available |
|
14 |
# Adding "--UNKNOWN" postfix to mark this situation |
|
15 |
VER=$(cd $(dirname $0); git describe --match "v*" 2> /dev/null)--UNKNOWN |
|
16 |
fi |
|
17 |
VER=$(echo $VER | sed "s/^v//" | sed "s/-\([0-9]*\)-\(g[0-9a-f]*\)/.\1~\2/") |
|
12 | 18 |
else |
13 | 19 |
VER=$(head -1 $(dirname $0)/../debian/changelog | awk '{ print $2 }' | tr -d '()' | cut -d '-' -f 1) |
14 | 20 |
fi |
15 |
- |