[postgis-tickets] r14732 - Automatically use GIT if a .git directory exists locally
Sandro Santilli
strk at keybit.net
Tue Mar 1 10:14:30 PST 2016
Author: strk
Date: 2016-03-01 10:14:30 -0800 (Tue, 01 Mar 2016)
New Revision: 14732
Modified:
trunk/make_dist.sh
Log:
Automatically use GIT if a .git directory exists locally
See #3482
Modified: trunk/make_dist.sh
===================================================================
--- trunk/make_dist.sh 2016-03-01 17:48:33 UTC (rev 14731)
+++ trunk/make_dist.sh 2016-03-01 18:14:30 UTC (rev 14732)
@@ -18,14 +18,21 @@
tag=trunk
version=dev
+git=no
+[ -d ".git" ] && git=yes
+[ "$git" = "yes" ] && tag=svn-$tag
+
if [ -n "$1" ]; then
if [ "$1" = "-b" ]; then
shift
tag="branches/$1"
+ [ "$git" = "yes" ] && tag=svn-$1
+ branch=yes
else
version="$1"
tag="tags/$version"
+ [ "$git" = "yes" ] && tag=$1
fi
fi
@@ -36,11 +43,18 @@
exit 1
fi
-echo "Exporting tag $tag"
-svnurl="http://svn.osgeo.org/postgis/$tag"
-svn export $svnurl "$outdir"
-if [ $? -gt 0 ]; then
- exit 1
+if [ "$git" = "no" ]; then
+ echo "Exporting tag $tag"
+ svnurl="http://svn.osgeo.org/postgis/$tag"
+ svn export $svnurl "$outdir"
+ if [ $? -gt 0 ]; then
+ exit 1
+ fi
+else
+ git clone -b $tag . $outdir || exit 1
+ #cd $outdir
+ #git checkout $tag || exit 1
+ #cd -
fi
echo "Removing ignore files, make_dist.sh and HOWTO_RELEASE"
@@ -77,6 +91,10 @@
owd="$PWD"
cd "$outdir"
make distclean
+if [ "$git" = "yes" ]; then
+ echo "Removing .git dir"
+ rm -rf .git
+fi
cd "$owd"
# Find a better version name when fetching
More information about the postgis-tickets
mailing list