Files
MINGW-packages/mingw-w64-octopi-git/0014-MSYS2-Support-discoverBinaryPath.patch
2016-06-01 21:10:15 +01:00

31 lines
1006 B
Diff

From 46131e980ca8bed3677e5b9e8d33accd6c1051ac Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Tue, 30 Sep 2014 19:12:30 +0100
Subject: [PATCH 14/14] MSYS2: Support discoverBinaryPath()
---
src/unixcommand.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/unixcommand.cpp b/src/unixcommand.cpp
index e1ad5a0..4f6ef34 100644
--- a/src/unixcommand.cpp
+++ b/src/unixcommand.cpp
@@ -85,7 +85,12 @@ QString UnixCommand::discoverBinaryPath(const QString& binary){
proc.setProcessEnvironment(getEnv());
proc.setProcessChannelMode(QProcess::MergedChannels);
- proc.start("/bin/sh -c \"which " + binary + "\"");
+ QString cmd;
+ if (UnixCommand::getLinuxDistro() == ectn_MSYS2)
+ cmd = ctn_MSYS2_SH + UnixCommand::getMSYS2Root() + "/usr/bin/sh -c \"which " + binary + "\"";
+ else
+ cmd = "/bin/sh -c \"which " + binary + "\"";
+ proc.start(cmd);
proc.waitForFinished();
QString res = proc.readAllStandardOutput();
--
2.8.2