Release 0.7.43.324.58ce66e
[nginx-catap.git] / version.sh
blob7dfdea8ddf24a54f5b277422fd14c041b109e2d4
1 #!/bin/bash
2 test -d .git || exit 0
3 git rev-list HEAD | sort > config.git-hash
4 LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
5 if [ $LOCALVER \> 1 ] ; then
6 VER=`git rev-list origin/master | sort | join config.git-hash - | wc -l | awk '{print $1}'`
7 if [ $VER != $LOCALVER ] ; then
8 VER="$VER+$(($LOCALVER-$VER))"
9 elif git status | grep -q "modified:" ; then
10 VER="${VER}M"
12 VER="$VER.$(git rev-list HEAD -n 1 | head -c 7)"
13 else
14 VER="x"
16 rm -f config.git-hash
17 sed -i -e "s:\"\([0-9]*\.[0-9]*\.[0-9]*\).*\".*$:\"\1\.$VER\":g" \
18 -e "s:\"nginx/\":\"nginx-catap/\":g" \
19 src/core/nginx.h