From c567e3a04383bc7b0ac9f1c0212418c578f72bec Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 3 Mar 2016 09:22:13 +0000 Subject: [PATCH] Have make_dist.sh use current branch as the default target branch Works both with GIT and SVN git-svn-id: http://svn.osgeo.org/postgis/trunk@14738 b70326c6-7e19-0410-871a-916f4a2858ee --- make_dist.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/make_dist.sh b/make_dist.sh index cfc1e9162..b1d6229f1 100755 --- a/make_dist.sh +++ b/make_dist.sh @@ -21,9 +21,7 @@ # # -tag=trunk version=dev -git=no # Define in environment if necessary to get postgis to configure, # which is only done to build comments. @@ -34,14 +32,27 @@ if [ "$MAKE" = "" ]; then MAKE=make fi -[ -d ".git" ] && git=yes -[ "$git" = "yes" ] && tag=svn-$tag +if [ -d ".git" ]; then + git=yes + # Extract tag from git or default to trunk + tag=`git branch | grep \* | awk '{print $2}'` +else + git=no + # Extract tag from svn or default to trunk + tag=`svn info 2> /dev/null | grep ^URL | sed 's/.*\///'` + [ -z "$tag" ] && tag=trunk + [ "$tag" != "trunk" ] && tag=branches/$tag +fi if [ -n "$1" ]; then if [ "$1" = "-b" ]; then shift - tag="branches/$1" - [ "$git" = "yes" ] && tag=svn-$1 + if [ "$git" = "yes" ]; then + tag=svn-$1 + else + tag="$1" + [ "$tag" != "trunk" ] && tag="branches/$tag" + fi branch=yes else version="$1" -- 2.40.0