From 0dff2ece7591aea3aaa8a1bd48c9ac422a8b9c95 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 19 Jan 2024 13:02:59 +0100 Subject: [PATCH] Check ISMAS update trigger as very first thing. Save the result in m_ismasTriggerActive for later use. --- worker.cpp | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/worker.cpp b/worker.cpp index c58b862..5c18467 100644 --- a/worker.cpp +++ b/worker.cpp @@ -260,6 +260,34 @@ void Worker::privateUpdate() { QScopedPointer upr(new UpdateProcessRunning(this)); + //////////////////////////////////////////////////////////////////////////// + // + // CHECK UPDATE TRIGGER + // + //////////////////////////////////////////////////////////////////////////// + // NOTE: make sure that nothing is sent to ISMAS during updateTriggerSet + ISMAS() << UPDATE_STEP::CHECK_ISMAS_TRIGGER; + m_ismasTriggerActive = false; + m_updateNotNecessary = false; + + m_ismasTriggerActive = updateTriggerSet(); + if (m_ismasTriggerActive == false) { + if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository + m_versionInfo = m_gc.gitShowReason(m_branchName); + QDateTime const ¤t = QDateTime::currentDateTime(); + if (current.time().hour() < 4) { // update has been triggered within [00:00:00, 00:03:59] + m_updateNotNecessary = true; + m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate))); + m_lastFailedUpdateStep = UPDATE_STEP::NONE; + } + // the customer-repository does exist, but the ISMAS-trigger is + // *NOT* "WAIT", so STOP the update procedure + return; + } + // in case the customer-repository does not exist, so PROCEED with the + // update procedure, even if ISMAS-trigger is not correctly set ("WAIT") + } + QDir customerRepository(m_customerRepository); QDir customerRepositoryEtc(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/")); @@ -347,14 +375,8 @@ void Worker::privateUpdate() { setProgress(_CHECKOUT_REPOSITORY_SUCCESS); - //////////////////////////////////////////////////////////////////////////// - // - // CHECK UPDATE TRIGGER - // - //////////////////////////////////////////////////////////////////////////// - m_ismasTriggerActive = false; if (m_clone == false) { - if ((continueUpdate = updateTriggerSet()) == false) { + if (m_ismasTriggerActive == false) { return; } else { GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER_SUCCESS));