[postgis-tickets] r14738 - Have make_dist.sh use current branch as the default target branch
Sandro Santilli
strk at keybit.net
Thu Mar 3 01:22:13 PST 2016
Author: strk
Date: 2016-03-03 01:22:13 -0800 (Thu, 03 Mar 2016)
New Revision: 14738
Modified:
trunk/make_dist.sh
Log:
Have make_dist.sh use current branch as the default target branch
Works both with GIT and SVN
Modified: trunk/make_dist.sh
===================================================================
--- trunk/make_dist.sh 2016-03-03 08:40:22 UTC (rev 14737)
+++ trunk/make_dist.sh 2016-03-03 09:22:13 UTC (rev 14738)
@@ -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 @@
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"
More information about the postgis-tickets
mailing list