TAG to use _ instead of .

master
Trevor Batley 2 months ago
parent 1e00424274
commit 452e84b2ca

@ -4,13 +4,14 @@
# $2 = Organisation (smeserver or smecontrib)e
# optional (can be in any order)
# <local> will use parameters set for local repository else it will use remote
# <purge> will purge all old tags
# <debug> turn on debug regardless of ~/.smegit/config
# <noisy> print a line showing how it was called
# Module name must exist
#
if [[ -z $1 ]] ; then
echo "************git-retag.sh <modulename> <organization> [<local> | <debug>]"
echo "************git-retag.sh <modulename> <organization> [<local> | <purge> | <debug> | <noisy>]"
exit 0
fi
@ -31,7 +32,7 @@ if [ ! -e $inifilename ] ; then
# Not here, look at system default
if [ ! -e /etc/smegit.ini ] ; then
echo "No ini file found $inifiename or /etc/smegit.ini"
echo "git-retag.sh <modulename> <organization> [<local> | <debug>]"
echo "git-retag.sh <modulename> <organization> [<local> | <purge> | <debug> | <noisy>]"
exit 1
else
initfilename="/etc/smegit.ini"
@ -75,7 +76,7 @@ for param in $3 $4 $5 $6 ; do
DEBUG=true ;;
noisy )
NOISY=true ;;
clean )
purge )
CLEAN=true ;;
* )
echo "Unkown parameter: $param"
@ -147,6 +148,7 @@ if [ $CLEAN ] ; then
OLDTAGS=$(git tag --list)
# delete old tag/s
for tag in $OLDTAGS ; do
if [ $DEBUG ] ; then echo "Removing tag $tag" ; fi
git tag --delete $tag
git push origin --delete $tag
git push --tags
@ -156,6 +158,7 @@ fi
VERSION_RELEASE_LONG=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec`
VERSION_RELEASE=${VERSION_RELEASE_LONG%%$'\n'*}
VERSION=${VERSION_RELEASE% *}
VERSION=${VERSION//./_}
RELEASE=${VERSION_RELEASE#* }
TAG=$VERSION"-"${RELEASE%.*}
if [ $DEBUG ] ; then
@ -168,5 +171,6 @@ git pull
git tag -a $TAG -m "Setting tag to current Version-Release in spec file: $TAG"
git push origin --tag $TAG $QUIET
echo "Current $ORGGITEA/$REPO_NAME tagged as $TAG - old tags removed"
echo "Current $ORGGITEA/$REPO_NAME tagged as $TAG"
if [ $CLEAN ] ; then echo " - old tags removed" ; fi
exit 0

Loading…
Cancel
Save