3 git
--version 2>/dev
/null
1>/dev
/null ||
exit 0
4 git rev-list HEAD |
sort > config.git-hash
5 LOCALVER
=`wc -l config.git-hash | awk '{print $1}'`
6 if [ $LOCALVER \
> 1 ] ; then
7 VER
=`git rev-list origin/master | sort | join config.git-hash - | wc -l | awk '{print $1}'`
8 if [ $VER != $LOCALVER ] ; then
9 VER
="$VER+$(($LOCALVER-$VER))"
10 elif git status |
grep -q "modified:" ; then
13 VER
="$VER.$(git rev-list HEAD -n 1 | head -c 7)"
18 sed -i -e "s:\"\([0-9]*\.[0-9]*\.[0-9]*\).*\".*$:\"\1\.$VER\":g" \
19 -e "s:\"nginx/\":\"nginx-catap/\":g" \
21 sed -i -e "s:'\([0-9]*\.[0-9]*\.[0-9]*\).*'.*$:\'\1\.$VER\';:g" \
22 src
/http
/modules
/perl
/nginx.pm