Skip to content

Commit 2f2be74

Browse files
committed
Use a more portable platform test.
1 parent 2a49585 commit 2f2be74

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

contrib/pg_upgrade/test.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e
1515
: ${PGPORT=50432}
1616
export PGPORT
1717

18-
testhost=`uname -o`
18+
testhost=`uname -s`
1919

2020
temp_root=$PWD/tmp_check
2121

@@ -110,23 +110,22 @@ pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir"
110110

111111
pg_ctl start -l "$logdir/postmaster2.log" -o '-F' -w
112112

113-
if [ $testhost = Msys ] ; then
114-
cmd /c analyze_new_cluster.bat
115-
else
116-
sh ./analyze_new_cluster.sh
117-
fi
113+
case $testhost in
114+
MINGW*) cmd /c analyze_new_cluster.bat ;;
115+
*) sh ./analyze_new_cluster.sh ;;
116+
esac
117+
118118
pg_dumpall -f "$temp_root"/dump2.sql || pg_dumpall2_status=$?
119119
pg_ctl -m fast stop
120120
if [ -n "$pg_dumpall2_status" ]; then
121121
echo "pg_dumpall of post-upgrade database cluster failed"
122122
exit 1
123123
fi
124124

125-
if [ $testhost = Msys ] ; then
126-
cmd /c delete_old_cluster.bat
127-
else
128-
sh ./delete_old_cluster.sh
129-
fi
125+
case $testhost in
126+
MINGW*) cmd /c delete_old_cluster.bat ;;
127+
*) sh ./delete_old_cluster.sh ;;
128+
esac
130129

131130
if diff -q "$temp_root"/dump1.sql "$temp_root"/dump2.sql; then
132131
echo PASSED

0 commit comments

Comments
 (0)