...
 
......@@ -134,7 +134,7 @@ static QStringList availableArches(const KDevelop::Path& url)
const auto doc = FlatpakRuntime::config(url);
const QString sdkName = doc[QLatin1String("sdk")].toString();
const QString runtimeVersion = doc[QLatin1String("runtime-version")].toString();
const QString match = sdkName + QLatin1String("/(.+)/") + runtimeVersion + QLatin1Char('$');
const QString match = sdkName + QLatin1String("/(.+)/") + runtimeVersion;
QObject::connect(&supportedArchesProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
&supportedArchesProcess, [&supportedArchesProcess, &match, &ret]() {
QTextStream stream(&supportedArchesProcess);
......@@ -148,7 +148,7 @@ static QStringList availableArches(const KDevelop::Path& url)
}
});
supportedArchesProcess.start(QStringLiteral("flatpak"), {QStringLiteral("list"), QStringLiteral("--runtime"), QStringLiteral("--columns=ref") });
supportedArchesProcess.start(QStringLiteral("flatpak"), {QStringLiteral("list"), QStringLiteral("--runtime") });
supportedArchesProcess.waitForFinished();
return ret;
}
......
......@@ -98,7 +98,12 @@ void FlatpakRuntime::setEnabled(bool /*enable*/)
void FlatpakRuntime::startProcess(QProcess* process) const
{
const QStringList args = m_finishArgs + QStringList{QStringLiteral("build"), QStringLiteral("--talk-name=org.freedesktop.DBus"), m_buildDirectory.toLocalFile(), process->program()} << process->arguments();
//Take any environment variables specified in process and pass through to flatpak.
QStringList env_args;
for(QString env_var: process->processEnvironment().toStringList()) {
env_args << QLatin1String("--env=") + env_var;
}
const QStringList args = m_finishArgs + env_args + QStringList{QStringLiteral("build"), QStringLiteral("--talk-name=org.freedesktop.DBus"), m_buildDirectory.toLocalFile(), process->program()} << process->arguments();
process->setProgram(QStringLiteral("flatpak"));
process->setArguments(args);
......@@ -108,7 +113,12 @@ void FlatpakRuntime::startProcess(QProcess* process) const
void FlatpakRuntime::startProcess(KProcess* process) const
{
process->setProgram(QStringList{QStringLiteral("flatpak")} << m_finishArgs << QStringList{QStringLiteral("build"), QStringLiteral("--talk-name=org.freedesktop.DBus"), m_buildDirectory.toLocalFile() } << process->program());
//Take any environment variables specified in process and pass through to flatpak.
QStringList env_args;
for(QString env_var: process->processEnvironment().toStringList()) {
env_args << QLatin1String("--env=") + env_var;
}
process->setProgram(QStringList{QStringLiteral("flatpak")} << m_finishArgs << env_args << QStringList{QStringLiteral("build"), QStringLiteral("--talk-name=org.freedesktop.DBus"), m_buildDirectory.toLocalFile() } << process->program());
qCDebug(FLATPAK) << "starting kprocess" << process->program().join(QLatin1Char(' '));
process->start();
......