Always execute commands contained in opkg_commands, even if no

change in opkg_commands. WAIT button in ISMAS must still be activated.
This commit is contained in:
Gerhard Hoffmann 2023-09-28 11:57:17 +02:00
parent fef1d43d5f
commit c09682ea33

View File

@ -727,6 +727,10 @@ bool Worker::customerEnvironment(int progress) {
bool Worker::filesToUpdate() { bool Worker::filesToUpdate() {
emit appendText("\nFetch changes files ..."); emit appendText("\nFetch changes files ...");
startProgressLoop(); startProgressLoop();
// always execute contents of opkg_commands-file
m_filesToUpdate << "etc/psa_update/opkg_commands";
if (std::optional<QString> changes = m_gc.gitFetch()) { if (std::optional<QString> changes = m_gc.gitFetch()) {
stopProgressLoop(); stopProgressLoop();
int progress = (m_mainWindow->progressValue()/10) + 10; int progress = (m_mainWindow->progressValue()/10) + 10;
@ -741,38 +745,38 @@ bool Worker::filesToUpdate() {
setProgress(progress + 20); setProgress(progress + 20);
if (m_gc.gitPull()) { if (m_gc.gitPull()) {
emit replaceLast(QString("Fetch changes files ..."), UPDATE_STEP_DONE); emit replaceLast(QString("Fetch changes files ..."), UPDATE_STEP_DONE);
m_filesToUpdate = changedFileNames.value(); m_filesToUpdate << changedFileNames.value();
} else {
Utils::printInfoMsg("FILES-TO-UPDATE " + m_filesToUpdate.join(','));
stopProgressLoop();
setProgress(100);
return false;
}
emit showErrorMessage("files to update", "pulling files failed"); emit showErrorMessage("files to update", "pulling files failed");
Utils::printCriticalErrorMsg("PULLING FILES FAILED"); Utils::printCriticalErrorMsg("PULLING FILES FAILED");
} else {
emit showErrorMessage("files to update", "no files to update (checked-in any files?)");
Utils::printCriticalErrorMsg("NO FILES TO UPDATE (CHECKED IN ANY FILES?)");
}
setProgress(progress + 30);
} else {
stopProgressLoop();
int progress = (m_mainWindow->progressValue()/10) + 10;
setProgress(progress + 30);
emit showErrorMessage("files to update",
QString("no changes in ") + m_customerRepository +
" (checked-in any files?)");
setProgress(progress + 30);
}
emit replaceLast(QString("Fetch changes files ..."), UPDATE_STEP_FAIL); emit replaceLast(QString("Fetch changes files ..."), UPDATE_STEP_FAIL);
stopProgressLoop();
setProgress(100); setProgress(100);
return false; return false;
}
}
Utils::printInfoMsg("FILES-TO-UPDATE " + m_filesToUpdate.join(','));
m_filesToUpdate.removeDuplicates();
int const size = m_filesToUpdate.size();
if (size > 1) {
emit appendText(QString("Found %1 files to update :").arg(size), UPDATE_STEP_DONE);
for (int i = 0; i < size; ++i) {
emit appendText(QString("\n ") + m_filesToUpdate.at(i));
}
} else {
emit appendText("Found 1 file to update :", UPDATE_STEP_DONE);
emit appendText(QString("\n ") + m_filesToUpdate.at(0));
}
setProgress(progress + 30);
}
return true;
} }
bool Worker::updateFiles(quint8 percent) { bool Worker::updateFiles(quint8 percent) {