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

Commitc737a2e

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 parentc2b51cf commitc737a2e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

‎contrib/pg_upgrade/test.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,18 @@ mkdir "$logdir"
7676

7777
# Clear out any environment vars that might cause libpq to connect to
7878
# the wrong postmaster (cf pg_regress.c)
79-
unset PGDATABASE
80-
unset PGUSER
81-
unset PGSERVICE
82-
unset PGSSLMODE
83-
unset PGREQUIRESSL
84-
unset PGCONNECT_TIMEOUT
85-
unset PGHOST
86-
unset PGHOSTADDR
79+
#
80+
# Some shells, such as NetBSD's, return non-zero from unset if the variable
81+
# is already unset. Since we are operating under 'set -e', this causes the
82+
# script to fail. To guard against this, set them all to an empty string first.
83+
PGDATABASE="";unset PGDATABASE
84+
PGUSER="";unset PGUSER
85+
PGSERVICE="";unset PGSERVICE
86+
PGSSLMODE=""unset PGSSLMODE
87+
PGREQUIRESSL="";unset PGREQUIRESSL
88+
PGCONNECT_TIMEOUT="";unset PGCONNECT_TIMEOUT
89+
PGHOST=""unset PGHOST
90+
PGHOSTADDR="";unset PGHOSTADDR
8791

8892
# Select a non-conflicting port number, similarly to pg_regress.c
8993
PG_VERSION_NUM=`grep'#define PG_VERSION_NUM'$newsrc/src/include/pg_config.h| awk'{print $3}'`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp