From 2e7d33c4c842b03a909ed4400bc0759c7a7dc9f3 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 5 Oct 2023 10:54:19 +0200 Subject: [PATCH] Set version to 1.3.7: wait forever for git-commands to finish in QProcess. --- OnDemandUpdatePTU.pro | 4 +++- process/command.cpp | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OnDemandUpdatePTU.pro b/OnDemandUpdatePTU.pro index f72dc67..c80a03e 100644 --- a/OnDemandUpdatePTU.pro +++ b/OnDemandUpdatePTU.pro @@ -21,6 +21,8 @@ DEFINES += QT_DEPRECATED_WARNINGS # Fixed sending messages to ISMAS. # Always execute contents of opkg_commands-file (even if there are no # changes). +# 1.3.7 : Wait forever for git-commands to finish in QProcess executing such +# a command. win32 { BUILD_DATE=$$system("date /t") @@ -30,7 +32,7 @@ win32 { BUILD_TIME=$$system("date +%H:%M:%S") } -VERSION="1.3.6" +VERSION="1.3.7" INCLUDEPATH += plugins diff --git a/process/command.cpp b/process/command.cpp index 22b03a4..e57532b 100644 --- a/process/command.cpp +++ b/process/command.cpp @@ -69,7 +69,10 @@ bool Command::execute(QString workingDirectory, QStringList args) { qDebug() << "PROCESS" << m_command << "STARTED IN" << p->workingDirectory(); if (p->state() == QProcess::ProcessState::Running) { qDebug() << "PROCESS" << m_command << "RUNNING IN" << p->workingDirectory(); - if (p->waitForFinished(m_waitForFinishTimeout)) { + // wait forever fot git-commands to finish + int const wait = m_command.trimmed().startsWith("git", Qt::CaseInsensitive) ? -1 : m_waitForFinishTimeout; + bool const no_timeout = p->waitForFinished(wait); + if (no_timeout) { qDebug() << "PROCESS" << m_command << "FINISHED IN" << p->workingDirectory(); if (p->exitStatus() == QProcess::NormalExit) { if ((m_exitCode = p->exitCode()) == 0) { @@ -89,8 +92,8 @@ bool Command::execute(QString workingDirectory, QStringList args) { } } else { qCritical() << "PROCESS" << m_command - << "DID NOT FINISH" - << "IN" << p->workingDirectory(); + << "DID NOT FINISH WITH" << wait + << "MS IN" << p->workingDirectory(); } } else { qCritical() << "WRONG PROCESS STATE" << p->state()