Skip to content

Commit c567e3a

Browse files
author
Sandro Santilli
committedMar 3, 2016
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
1 parent 53de0e3 commit c567e3a

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed
 

‎make_dist.sh

+17-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
#
2222
#
2323

24-
tag=trunk
2524
version=dev
26-
git=no
2725

2826
# Define in environment if necessary to get postgis to configure,
2927
# which is only done to build comments.
@@ -34,14 +32,27 @@ if [ "$MAKE" = "" ]; then
3432
MAKE=make
3533
fi
3634

37-
[ -d ".git" ] && git=yes
38-
[ "$git" = "yes" ] && tag=svn-$tag
35+
if [ -d ".git" ]; then
36+
git=yes
37+
# Extract tag from git or default to trunk
38+
tag=`git branch | grep \* | awk '{print $2}'`
39+
else
40+
git=no
41+
# Extract tag from svn or default to trunk
42+
tag=`svn info 2> /dev/null | grep ^URL | sed 's/.*\///'`
43+
[ -z "$tag" ] && tag=trunk
44+
[ "$tag" != "trunk" ] && tag=branches/$tag
45+
fi
3946

4047
if [ -n "$1" ]; then
4148
if [ "$1" = "-b" ]; then
4249
shift
43-
tag="branches/$1"
44-
[ "$git" = "yes" ] && tag=svn-$1
50+
if [ "$git" = "yes" ]; then
51+
tag=svn-$1
52+
else
53+
tag="$1"
54+
[ "$tag" != "trunk" ] && tag="branches/$tag"
55+
fi
4556
branch=yes
4657
else
4758
version="$1"

0 commit comments

Comments
 (0)
Please sign in to comment.