]> granicus.if.org Git - postgis/commitdiff
Embed full version (and revision) in package name for dev snapshots.
authorSandro Santilli <strk@keybit.net>
Thu, 4 Jun 2015 08:09:52 +0000 (08:09 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 4 Jun 2015 08:09:52 +0000 (08:09 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13614 b70326c6-7e19-0410-871a-916f4a2858ee

make_dist.sh

index 46f9f294d8ea93d1b738414a4500c53cdec1e70f..e3ab98f85709f5e27c42df568b7a55038c977906 100755 (executable)
@@ -24,7 +24,6 @@ if [ -n "$1" ]; then
 fi
 
 outdir="postgis-$version"
-package="postgis-$version.tar.gz"
 
 if [ -d "$outdir" ]; then
        echo "Output directory $outdir already exists."
@@ -74,6 +73,21 @@ cd "$outdir"
 make distclean
 cd "$owd"
 
+# Find a better version name when fetching
+# a development branch
+if test "$tag" = "trunk"; then
+  echo "Tweaking version for development snapshot"
+  VMAJ=`grep POSTGIS_MAJOR_VERSION "$outdir"/Version.config | cut -d= -f2`
+  VMIN=`grep POSTGIS_MINOR_VERSION "$outdir"/Version.config | cut -d= -f2`
+  VMIC=`grep POSTGIS_MICRO_VERSION "$outdir"/Version.config | cut -d= -f2`
+  VREV=`cat "$outdir"/postgis_svn_revision.h | awk '{print $3}'`
+  version="${VMAJ}.${VMIN}.${VMIC}-r${VREV}"
+  newoutdir=postgis-${version}
+  mv -vi "$outdir" "$newoutdir"
+  outdir=${newoutdir}
+fi
+
+package="postgis-$version.tar.gz"
 echo "Generating $package file"
 tar czf "$package" "$outdir"