]> granicus.if.org Git - postgresql/commitdiff
Fix unportable shell-script syntax in pg_upgrade's test.sh.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Mar 2014 01:55:10 +0000 (21:55 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Mar 2014 01:55:10 +0000 (21:55 -0400)
I discovered the hard way that on some old shells, the locution
    FOO=""   unset FOO
does not behave the same as
    FOO="";  unset FOO
and in fact leaves FOO set to an empty string.  test.sh was inconsistently
spelling it different ways on adjacent lines.

This got broken relatively recently, in commit c737a2e56, so the lack of
field reports to date doesn't represent a lot of evidence that the problem
is rare.

contrib/pg_upgrade/test.sh

index 3be0304d16fca316d4b7a6127313e154ae9cb7ff..28130f16010720104aae2b73c55334905a73b86d 100644 (file)
@@ -76,10 +76,10 @@ rm -rf "$BASE_PGDATA" "$PGDATA"
 PGDATABASE="";        unset PGDATABASE
 PGUSER="";            unset PGUSER
 PGSERVICE="";         unset PGSERVICE
-PGSSLMODE=""          unset PGSSLMODE
+PGSSLMODE="";         unset PGSSLMODE
 PGREQUIRESSL="";      unset PGREQUIRESSL
 PGCONNECT_TIMEOUT=""; unset PGCONNECT_TIMEOUT
-PGHOST=""             unset PGHOST
+PGHOST="";            unset PGHOST
 PGHOSTADDR="";        unset PGHOSTADDR
 
 logdir=$PWD/log