[libcalamares] Run ProcessJobs with CommandLine
This makes the behavior of process jobs and shellcommands the same.
This commit is contained in:
parent
4329b824d4
commit
2697c35fc7
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
#include "ProcessJob.h"
|
#include "ProcessJob.h"
|
||||||
|
|
||||||
|
#include "utils/CommandList.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/System.h"
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@ -57,23 +57,9 @@ ProcessJob::prettyStatusMessage() const
|
|||||||
JobResult
|
JobResult
|
||||||
ProcessJob::exec()
|
ProcessJob::exec()
|
||||||
{
|
{
|
||||||
using Calamares::System;
|
Calamares::CommandList l( m_runInChroot, m_timeoutSec );
|
||||||
|
l.push_back( Calamares::CommandLine { m_command } );
|
||||||
if ( m_runInChroot )
|
return l.run();
|
||||||
{
|
|
||||||
return Calamares::System::instance()
|
|
||||||
->targetEnvCommand( { m_command }, m_workingPath, QString(), m_timeoutSec )
|
|
||||||
.explainProcess( m_command, m_timeoutSec );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return System::runCommand( System::RunLocation::RunInHost,
|
|
||||||
{ "/bin/sh", "-c", m_command },
|
|
||||||
m_workingPath,
|
|
||||||
QString(),
|
|
||||||
m_timeoutSec )
|
|
||||||
.explainProcess( m_command, m_timeoutSec );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
Loading…
Reference in New Issue
Block a user