Skip to content

Commit e442b0f

Browse files
committed
Allow pg_upgrade "make check" to run on Windows/MSys.
Backpatch to 9.2.
1 parent a80b803 commit e442b0f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

contrib/pg_upgrade/test.sh

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

18+
testhost=`uname -o`
19+
1820
temp_root=$PWD/tmp_check
1921

2022
if [ "$1" = '--install' ]; then
@@ -107,15 +109,28 @@ initdb
107109
pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir"
108110

109111
pg_ctl start -l "$logdir/postmaster2.log" -w
110-
sh ./analyze_new_cluster.sh
112+
113+
if [ $testhost = Msys ] ; then
114+
cmd /c analyze_new_cluster.bat
115+
else
116+
sh ./analyze_new_cluster.sh
117+
fi
111118
pg_dumpall >"$temp_root"/dump2.sql || pg_dumpall2_status=$?
112119
pg_ctl -m fast stop
113120
if [ -n "$pg_dumpall2_status" ]; then
114121
echo "pg_dumpall of post-upgrade database cluster failed"
115122
exit 1
116123
fi
117124

118-
sh ./delete_old_cluster.sh
125+
if [ $testhost = Msys ] ; then
126+
cmd /c delete_old_cluster.bat
127+
else
128+
sh ./delete_old_cluster.sh
129+
fi
130+
131+
if [ $testhost = Msys ] ; then
132+
dos2unix "$temp_root"/dump1.sql "$temp_root"/dump2.sql
133+
fi
119134

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy