[libcalamares] runCommand doesn't need queue or settings
- JobQueue is only needed to get global settings, which are needed when running in the target; for host commands, allow running without a queue. - Settings is needed for the value of debugsettings; assume if there's no settings object, that we're in a test and should print debugging information.
This commit is contained in:
parent
5a835f32b8
commit
7be33b8196
@ -156,13 +156,8 @@ System::runCommand(
|
|||||||
{
|
{
|
||||||
QString output;
|
QString output;
|
||||||
|
|
||||||
if ( !Calamares::JobQueue::instance() )
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance() ? Calamares::JobQueue::instance()->globalStorage() : nullptr;
|
||||||
{
|
|
||||||
cError() << "No JobQueue";
|
|
||||||
return ProcessResult::Code::NoWorkingDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
|
||||||
if ( ( location == System::RunLocation::RunInTarget ) &&
|
if ( ( location == System::RunLocation::RunInTarget ) &&
|
||||||
( !gs || !gs->contains( "rootMountPoint" ) ) )
|
( !gs || !gs->contains( "rootMountPoint" ) ) )
|
||||||
{
|
{
|
||||||
@ -239,7 +234,8 @@ System::runCommand(
|
|||||||
|
|
||||||
auto r = process.exitCode();
|
auto r = process.exitCode();
|
||||||
cDebug() << "Finished. Exit code:" << r;
|
cDebug() << "Finished. Exit code:" << r;
|
||||||
if ( ( r != 0 ) || Calamares::Settings::instance()->debugMode() )
|
bool showDebug = ( !Calamares::Settings::instance() ) || ( Calamares::Settings::instance()->debugMode() );
|
||||||
|
if ( ( r != 0 ) || showDebug )
|
||||||
{
|
{
|
||||||
cDebug() << "Target cmd:" << RedactedList( args );
|
cDebug() << "Target cmd:" << RedactedList( args );
|
||||||
cDebug().noquote().nospace() << "Target output:\n" << output;
|
cDebug().noquote().nospace() << "Target output:\n" << output;
|
||||||
|
Loading…
Reference in New Issue
Block a user