Skip to content

Commit 801b261

Browse files
committed
Prevent msys2 conversion of "cmd /c" switch to a file path
Modern versions of msys2 have changed the treatment of "cmd /c" so that the runtime will try to convert the switch to a native file path. This patch adds a setting to inhibit that behaviour. Discussion: https://postgr.es/m/3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com Backpatch to all live branches.
1 parent d0a98e1 commit 801b261

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bin/pg_upgrade/test.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,11 @@ pg_upgrade $PG_UPGRADE_OPTS -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B
240240

241241
pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w
242242

243+
# In the commands below we inhibit msys2 from converting the "/c" switch
244+
# in "cmd /c" to a file system path.
245+
243246
case $testhost in
244-
MINGW*) cmd /c analyze_new_cluster.bat ;;
247+
MINGW*) MSYS2_ARG_CONV_EXCL=/c cmd /c analyze_new_cluster.bat ;;
245248
*) sh ./analyze_new_cluster.sh ;;
246249
esac
247250

@@ -254,7 +257,7 @@ if [ -n "$pg_dumpall2_status" ]; then
254257
fi
255258

256259
case $testhost in
257-
MINGW*) cmd /c delete_old_cluster.bat ;;
260+
MINGW*) MSYS2_ARG_CONV_EXCL=/c cmd /c delete_old_cluster.bat ;;
258261
*) sh ./delete_old_cluster.sh ;;
259262
esac
260263

0 commit comments

Comments
 (0)