diff --git a/release.linux.sh b/release.linux.sh index 79d4c7f6..f5601c6a 100644 --- a/release.linux.sh +++ b/release.linux.sh @@ -1,23 +1,27 @@ #!/bin/sh -SVN_REVISION=`svnversion` -# only accept up to date, non modified, non switched svn revisions -if echo $SVN_REVISION | grep -q [:MS] -then - echo "bad subversion revision ($SVN_REVISION)" -# exit 1 -fi - make clean rm -rf build/linux/release/ -#/usr/local/Trolltech/Qt-4.6.1/bin/qmake /usr/bin/qmake-qt4 VERSION=`cat build/linux/release/version` if [ "$VERSION" = "" ]; then echo "version not found" exit 1 +else + LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" + if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then + echo creating a tag with the version $VERSION + git tag -a "v$VERSION" + git push origin --tags + else + if [ "$1" != "escape" ] ; then + echo "if you have already compiled a release (e.g. on a different os) please use the fallowing command line" + echo sh release.linux.sh escape + exit 2 + fi + fi fi make -j 4 release-install diff --git a/release.macx.sh b/release.macx.sh index 7766a4be..a7615abf 100644 --- a/release.macx.sh +++ b/release.macx.sh @@ -69,18 +69,24 @@ QMAKE_CMD="$QMAKE -spec macx-g++42" $QMAKE_CMD VERSION=`cat "$BUILD_DIR/version"` -if [ "$VERSION" == "" ]; then - abort "version not found" -fi - -SVN_REVISION=`svnversion` -# only accept up to date, non modified, non switched svn revisions -if echo $SVN_REVISION | grep -q [:MS] -then - #warn "bad subversion revision ($SVN_REVISION)" - echo "bad subversion revision ($SVN_REVISION)" +if [ "$VERSION" = "" ]; then + echo "version not found" + exit 1 +else + LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" + if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then + echo creating a tag with the version $VERSION + git tag -a "v$VERSION" + git push origin --tags + else + if [ "$1" != "escape" ] ; then + echo "if you have already compiled a release (e.g. on a different os) please use the fallowing command line" + echo sh release.macx.sh escape + exit 2 + fi + fi fi - + # build notify "Compiling ..." make -j4 release