[postgis-tickets] r16283 - revise make_dist.sh to allow overriding the package name

Sandro Santilli strk at kbt.io
Sat Jan 13 13:06:04 PST 2018


On Sat, Jan 13, 2018 at 09:48:28AM +0000, Regina Obe wrote:
> Author: robe
> Date: 2018-01-13 09:48:28 -0800 (Sat, 13 Jan 2018)
> New Revision: 16283

[...]

> Modified: trunk/make_dist.sh
> ===================================================================
> --- trunk/make_dist.sh	2018-01-13 07:05:29 UTC (rev 16282)
> +++ trunk/make_dist.sh	2018-01-13 17:48:28 UTC (rev 16283)
> @@ -18,8 +18,9 @@
>  #
>  #   CONFIGURE_ARGS    passed to ./configure call
>  #   MAKE              useed for builds (defaults to "make")
> +#   newoutdir  this variable can be overriden to control the outdir and package name.
> +#              package name will be set to {newoutdir}.tar.gz if this variabe is overridden

Why lowercase ?
Would it make more sense to call it PACKAGENAME ?

> +if [ -v "$outdir" ]; then
> +	echo "Output directory $outdir already exists."

Is -v a typo ? It is -d testing if a directory exists.
Beside, the check is performed below:

>  if [ -d "$outdir" ]; then

> @@ -130,16 +136,23 @@
>    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}
> +  #if newoutdir is not already set, then set it
> +  if test "x$newoutdir" = "x"; then
> +      newoutdir=postgis-${version}
> +  else
> +      package=${newoutdir}.tar.gz
> +  fi

The conditional above is weird, one branch sets "newoutdir"
and the other sets "package" ? What's the value of "package" 
when $newoutdir is set ?

> +#if package name is not already set then set it
> +if test "x$package" = "x"; then
> +    package="postgis-$version.tar.gz"
> +fi

Oh, here's what it's set to ? Why not doing this in the
previous conditional ?

--strk;


More information about the postgis-tickets mailing list