#!/bin/sh # # This script creates a packaging tag # # Parameters # $1 : version # # Environment variable that MUST be defined # by the calling script # # SVN_URL SVN_USER SVN_PASS # # Source functions # . `dirname $0`/functions # # Binaries # BIN_ECHO="/bin/echo" BIN_SVN="/usr/bin/svn" # # Parameters # SVN_VERSION="" # # Internal variables # EXIT=0 # # Main script # if [ $EXIT -eq 0 ] ; then check_svn_parameters if [ -z "$1" ] ; then $BIN_ECHO "-> SVN version parameter is missing" EXIT=1 else SVN_VERSION=$1 fi fi if [ $EXIT -eq 0 ] ; then $BIN_SVN list --username $SVN_USER --password $SVN_PASS $SVN_URL/tags/packaging/$SVN_VERSION >> /dev/null 2>&1 if [ $? -eq 0 ] ; then $BIN_ECHO "-> Directory '$SVN_URL/tags/packaging/$SVN_VERSION' already exists" EXIT=1 fi fi if [ $EXIT -eq 0 ] ; then $BIN_SVN copy --username $SVN_USER --password $SVN_PASS -m "Create tag $SVN_VERSION of packaging" $SVN_URL/trunk/packaging $SVN_URL/tags/packaging/$SVN_VERSION >> /dev/null 2>&1 if [ $? -ne 0 ] ; then $BIN_ECHO "-> Error while creating tag '$SVN_URL/tags/packaging/$SVN_VERSION' from '$SVN_URL/trunk/packaging'" EXIT=1 fi fi exit $EXIT