If the repository is cloned (or repaired and cloned) and the settings

always-download-config and always-download-dc are set in the ini-file,
then download the json-files and dc-file, even without an activated
WAIT-button. The tariff-files are always synced for a clone.
This commit is contained in:
Gerhard Hoffmann 2023-12-13 13:49:22 +01:00
parent 38e7bf4985
commit 32346c2665

View File

@ -340,21 +340,30 @@ void Worker::privateUpdate() {
//
////////////////////////////////////////////////////////////////////////////
m_ismasTriggerActive = false;
if ((continueUpdate = updateTriggerSet()) == false) {
if (m_clone == false) {
if ((continueUpdate = updateTriggerSet()) == false) {
return;
} else {
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER_SUCCESS));
setProgress(_CHECK_ISMAS_TRIGGER_SUCCESS);
}
} else {
if (m_initialClone) {
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::INITIAL_CLONE_WITHOUT_ACTIVE_ISMAS_TRIGGER));
}
return;
} else {
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::INITIAL_CLONE_WITH_ACTIVE_ISMAS_TRIGGER));
}
qCritical() << "**** m_ismasTriggerActive:" << m_ismasTriggerActive;
qCritical() << "**** m_clone:" << m_clone;
if (m_ismasTriggerActive == false) {// make it explicit again: only if the
// ismas trigger is active ('WAIT'),
// then proceed
return;
}
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER_SUCCESS));
setProgress(_CHECK_ISMAS_TRIGGER_SUCCESS);
if (m_clone == false) { // if it is an (initial) clone, then
return; // run the whole update process:
} // sync tariff-files, download jsons,
} // download device controller
////////////////////////////////////////////////////////////////////////////
@ -650,10 +659,7 @@ bool Worker::filesToUpdate() {
// always execute contents of opkg_commands-file
m_filesToUpdate << "etc/psa_update/opkg_commands";
if (m_alwaysDownloadConfig) {
#if 0
QStringList lst(QString("m_alwaysDownloadConfig NOT TESTED"));
CONSOLE(lst) << UPDATE_STEP::UPDATE_REPOSITORY;
if (m_clone && m_alwaysDownloadConfig) {
// always download all json-config files, even if none of them have been
// changed in the git repository. useful for first installation.
QDir dir(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/psa_config"));
@ -663,24 +669,19 @@ bool Worker::filesToUpdate() {
m_filesToUpdate << jsons;
}
}
#endif
}
if (m_alwaysDownloadDC) {
#if 0
QStringList lst(QString("m_alwaysDownloadDC NOT TESTED"));
CONSOLE(lst) << UPDATE_STEP::UPDATE_REPOSITORY;
if (m_clone && m_alwaysDownloadDC) {
// always download the last dc-binary, even if not changed in the
// git repository. useful for first installation.
QDir dir(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/psa_update"));
QDir dir(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/dc"));
if (dir.exists()) {
QStringList dc = dir.entryList(QStringList() << "dc2c*.bin", QDir::Files,
QStringList dc = dir.entryList(QStringList() << "dc2c.bin", QDir::Files,
QDir::SortFlag::Time | QDir::SortFlag::Reversed);
if (!dc.isEmpty()) {
m_filesToUpdate << dc.first();
}
}
#endif
}
if (std::optional<QString> changes = m_gc.gitPull()) {
@ -713,8 +714,7 @@ bool Worker::computeFilesToDownload() {
fName.contains("DC2C_cash", Qt::CaseInsensitive)) {
m_filesToDownload << fName; // download printer-config-files
} else {
static const QRegularExpression version("^.*dc2c[.][0-9]{1,2}[.][0-9]{1,2}[.]bin.*$");
if (fName.contains(version)) {
if (fName.contains("dc2c.bin")) {
m_filesToDownload << fName; // download device controller
}
}