From 4815bf6963ea0fa1435c853f7d879e4c7d86a49b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 30 Jun 2024 15:07:03 +0200 Subject: [PATCH] [libcalamares] Expand runCommand() inline for CommandLine Since we want to hook up more to the runner, the simplified API in System::runCommand() is not sufficient. --- src/libcalamares/utils/CommandList.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/utils/CommandList.cpp b/src/libcalamares/utils/CommandList.cpp index 120cf5aa5..39254ec05 100644 --- a/src/libcalamares/utils/CommandList.cpp +++ b/src/libcalamares/utils/CommandList.cpp @@ -16,6 +16,7 @@ #include "compat/Variant.h" #include "locale/Global.h" #include "utils/Logger.h" +#include "utils/Runner.h" #include "utils/StringExpander.h" #include "utils/System.h" #include "utils/Variant.h" @@ -257,7 +258,10 @@ CommandList::run() shell_cmd << ( environmentSetting + processed_cmd ); std::chrono::seconds timeout = i->timeout() >= std::chrono::seconds::zero() ? i->timeout() : m_timeout; - ProcessResult r = System::runCommand( location, shell_cmd, QString(), QString(), timeout ); + + Calamares::Utils::Runner runner( shell_cmd ); + runner.setLocation( location ).setTimeout( timeout ).setWorkingDirectory( QString() ); + ProcessResult r = runner.run(); if ( r.getExitCode() != 0 ) {