Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9060cb9

Browse files
committed
Work around NetBSD shell issue in pg_upgrade test script.
The NetBSD shell apparently returns non-zero from an unset command ifthe variable is already unset. This matters when, as in pg_upgrade'stest.sh, we are working under 'set -e'. To protect against this, wefirst set the PG variables to an empty string before unsetting themcompletely.Error found on buildfarm member coypu, solution from Rémi Zara.
1 parent4da24f1 commit9060cb9

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

‎contrib/pg_upgrade/test.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,20 @@ PGDATA="$BASE_PGDATA.old"
6767
export PGDATA
6868
rm -rf"$BASE_PGDATA""$PGDATA"
6969

70-
unset PGDATABASE
71-
unset PGUSER
72-
unset PGSERVICE
73-
unset PGSSLMODE
74-
unset PGREQUIRESSL
75-
unset PGCONNECT_TIMEOUT
76-
unset PGHOST
77-
unset PGHOSTADDR
70+
# Clear out any environment vars that might cause libpq to connect to
71+
# the wrong postmaster (cf pg_regress.c)
72+
#
73+
# Some shells, such as NetBSD's, return non-zero from unset if the variable
74+
# is already unset. Since we are operating under 'set -e', this causes the
75+
# script to fail. To guard against this, set them all to an empty string first.
76+
PGDATABASE="";unset PGDATABASE
77+
PGUSER="";unset PGUSER
78+
PGSERVICE="";unset PGSERVICE
79+
PGSSLMODE=""unset PGSSLMODE
80+
PGREQUIRESSL="";unset PGREQUIRESSL
81+
PGCONNECT_TIMEOUT="";unset PGCONNECT_TIMEOUT
82+
PGHOST=""unset PGHOST
83+
PGHOSTADDR="";unset PGHOSTADDR
7884

7985
logdir=$PWD/log
8086
rm -rf"$logdir"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp