Skip to content

Commit 686f362

Browse files
committed
Fix contrib/pg_upgrade/test.sh for $PWD containing spaces.
Most of the necessary quoting was in place; this catches the exceptions.
1 parent c82725e commit 686f362

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contrib/pg_upgrade/test.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if [ "$1" = '--install' ]; then
8080
# use psql from the proper installation directory, which might
8181
# be outdated or missing. But don't override anything else that's
8282
# already in EXTRA_REGRESS_OPTS.
83-
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --psqldir=$bindir"
83+
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --psqldir='$bindir'"
8484
export EXTRA_REGRESS_OPTS
8585
fi
8686

@@ -117,7 +117,7 @@ PGCONNECT_TIMEOUT=""; unset PGCONNECT_TIMEOUT
117117
PGHOSTADDR=""; unset PGHOSTADDR
118118

119119
# Select a non-conflicting port number, similarly to pg_regress.c
120-
PG_VERSION_NUM=`grep '#define PG_VERSION_NUM' $newsrc/src/include/pg_config.h | awk '{print $3}'`
120+
PG_VERSION_NUM=`grep '#define PG_VERSION_NUM' "$newsrc"/src/include/pg_config.h | awk '{print $3}'`
121121
PGPORT=`expr $PG_VERSION_NUM % 16384 + 49152`
122122
export PGPORT
123123

@@ -141,8 +141,8 @@ export EXTRA_REGRESS_OPTS
141141
# enable echo so the user can see what is being executed
142142
set -x
143143

144-
$oldbindir/initdb -N
145-
$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w
144+
"$oldbindir"/initdb -N
145+
"$oldbindir"/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w
146146
if "$MAKE" -C "$oldsrc" installcheck; then
147147
pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
148148
if [ "$newsrc" != "$oldsrc" ]; then
@@ -167,7 +167,7 @@ if "$MAKE" -C "$oldsrc" installcheck; then
167167
else
168168
make_installcheck_status=$?
169169
fi
170-
$oldbindir/pg_ctl -m fast stop
170+
"$oldbindir"/pg_ctl -m fast stop
171171
if [ -n "$make_installcheck_status" ]; then
172172
exit 1
173173
fi

0 commit comments

Comments
 (0)