#!/bin/bash

MAJOR_VERSION=`cut -d '.' -f 1 qtpyui/version`
MINOR_VERSION=`cut -d '.' -f 2 qtpyui/version`
PATCH_VERSION=`cut -d '.' -f 3 qtpyui/version`

PATCH_VERSION=`expr $PATCH_VERSION + 1`
[ $PATCH_VERSION = "10" ] && MINOR_VERSION=`expr $MINOR_VERSION + 1` && PATCH_VERSION=0
[ $MINOR_VERSION = "10" ] && MAJOR_VERSION=`expr $MAJOR_VERSION + 1` && MINOR_VERSION=0

echo $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION > qtpyui/version

find qtpyui -regex ".*\(Makefile\|\.so.*\|\.o\|moc_.*\)" | xargs rm

files="*.sh qtpyui"

echo Creating backup set v$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION  `date +%d_%m_%y`
tar czf backup/qtpyui-v$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION''-`date +%d_%m_%y`.tar.gz $files


# rm -rf build.log toolchain build-qte qtopia-phone-4.3.0


