]> granicus.if.org Git - postgresql/commitdiff
Prevent msys2 conversion of "cmd /c" switch to a file path
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 9 Sep 2019 12:56:33 +0000 (08:56 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Mon, 9 Sep 2019 13:03:23 +0000 (09:03 -0400)
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.

src/bin/pg_upgrade/test.sh

index fb29f1de75a1ea8acc19533fb001a1be1ad5ad9a..0e90b359e37053a242bc800e4d22ab5134862836 100644 (file)
@@ -224,8 +224,11 @@ pg_upgrade $PG_UPGRADE_OPTS -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B
 
 pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w
 
+# In the commands below we inhibit msys2 from converting the "/c" switch
+# in "cmd /c" to a file system path.
+
 case $testhost in
-       MINGW*) cmd /c analyze_new_cluster.bat ;;
+       MINGW*) MSYS2_ARG_CONV_EXCL=/c cmd /c analyze_new_cluster.bat ;;
        *)              sh ./analyze_new_cluster.sh ;;
 esac
 
@@ -238,7 +241,7 @@ if [ -n "$pg_dumpall2_status" ]; then
 fi
 
 case $testhost in
-       MINGW*) cmd /c delete_old_cluster.bat ;;
+       MINGW*) MSYS2_ARG_CONV_EXCL=/c cmd /c delete_old_cluster.bat ;;
        *)          sh ./delete_old_cluster.sh ;;
 esac