aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-06-29 00:48:27 -0700
committerJake Petroules <jake.petroules@qt.io>2017-06-29 08:48:00 +0000
commit6c9aa189aa9f3a83cd1efc3b9b350a8d0be87cf6 (patch)
tree4333d9e2b0d5e2ccfdaa7e3fc12c4114cc436a39
parent8112ca60323e8342627bffe92ca8f00bfc5812cc (diff)
Make command-line-with-environment mode print in an executable form
command-line mode prints in a form that is directly copy-paste'able into a shell for re-execution, so command-line-with-environment should as well. On Windows the format remains unchanged, because it's not possible to set local environment variables for a command. Change-Id: I5e7a9db297fcbeda821f7b6b5e176d340b2c43cf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/lib/corelib/buildgraph/processcommandexecutor.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/processcommandexecutor.cpp b/src/lib/corelib/buildgraph/processcommandexecutor.cpp
index 6fecb73a4..4b435e71f 100644
--- a/src/lib/corelib/buildgraph/processcommandexecutor.cpp
+++ b/src/lib/corelib/buildgraph/processcommandexecutor.cpp
@@ -336,11 +336,14 @@ void ProcessCommandExecutor::onProcessFinished()
static QString environmentVariableString(const QString &key, const QString &value)
{
QString str;
- if (HostOsInfo::isAnyUnixHost())
- str += QStringLiteral("export ");
if (HostOsInfo::isWindowsHost())
str += QStringLiteral("set ");
- return str + shellQuote(key + QLatin1Char('=') + value) + QLatin1Char('\n');
+ str += shellQuote(key + QLatin1Char('=') + value);
+ if (HostOsInfo::isWindowsHost())
+ str += QLatin1Char('\n');
+ else
+ str += QLatin1Char(' ');
+ return str;
}
void ProcessCommandExecutor::doReportCommandDescription()