From d9546274897e16e1b4b586880fd938bf2fb69fe1 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 1 Mar 2016 18:14:30 +0000 Subject: [PATCH] Automatically use GIT if a .git directory exists locally See #3482 git-svn-id: http://svn.osgeo.org/postgis/trunk@14732 b70326c6-7e19-0410-871a-916f4a2858ee --- make_dist.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/make_dist.sh b/make_dist.sh index 68b0e424f..c267ad5db 100755 --- a/make_dist.sh +++ b/make_dist.sh @@ -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 @@ if [ -d "$outdir" ]; then 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 @@ echo "Running make distclean" 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 -- 2.40.0