pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: msys2 vs pg_upgrade/test.sh
Date: Sun, 8 Sep 2019 18:06:34 -0400
Message-ID: <3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com> (raw)


Diagnosing this took quite a lot of time and detective work. For some
reason I don't quite understand, when calling the Windows command
processor in a modern msys2/WindowsServer2019 installation, you need to
double the slash, thus:


    cmd //c foo.bat


Some Internet postings at least seem to suggest this is by design. (FSVO
"design")


I tested this on older versions and the change appears to work, so I
propose to apply the attached patch.


This is the last obstacle I have to declaring msys2 fully supportable.



cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

  [text/x-patch] pg_upgrade_msys2.patch (759B, ../3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com/2-pg_upgrade_msys2.patch)
  download | inline diff:
diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh
index c9de4f8a7e..2d78f63f5e 100644
--- a/src/bin/pg_upgrade/test.sh
+++ b/src/bin/pg_upgrade/test.sh
@@ -244,8 +244,11 @@ esac
 
 pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w
 
+# modern versions of msys/Windows require a double slash when calling
+# "cmd /c". This also works on older versions.
+
 case $testhost in
-	MINGW*)	cmd /c analyze_new_cluster.bat ;;
+	MINGW*)	cmd //c analyze_new_cluster.bat ;;
 	*)		sh ./analyze_new_cluster.sh ;;
 esac
 
@@ -258,7 +261,7 @@ if [ -n "$pg_dumpall2_status" ]; then
 fi
 
 case $testhost in
-	MINGW*)	cmd /c delete_old_cluster.bat ;;
+	MINGW*)	cmd //c delete_old_cluster.bat ;;
 	*)	    sh ./delete_old_cluster.sh ;;
 esac
 

view thread (3+ messages)  latest in thread

Message-ID: <3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com>
Permalink:  ../3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com/
Also on:    postgresql.org/message-id/3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andrew.dunstan@2ndquadrant.com
  Subject: Re: msys2 vs pg_upgrade/test.sh
  In-Reply-To: <3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox