let ISMAS know if some opkg commands fail

This commit is contained in:
Gerhard Hoffmann 2023-12-13 10:04:38 +01:00
parent a35c6afcb8
commit 0c9a7bc7b5

View File

@ -727,7 +727,7 @@ bool Worker::execOpkgCommands() {
if (f.open(QIODevice::ReadOnly)) {
QTextStream in(&f);
m_opkgCommands.clear();
bool executeOpkgCommandFailed = false;
QStringList opkgErrorLst;
while (!in.atEnd()) {
QString line = in.readLine();
static const QRegularExpression comment("^\\s*#.*$");
@ -735,7 +735,7 @@ bool Worker::execOpkgCommands() {
// found opkg command
QString opkgCommand = line.trimmed();
if (!executeOpkgCommand(opkgCommand)) {
executeOpkgCommandFailed = true;
opkgErrorLst << opkgCommand;
} else {
QString cmd = "\n " + opkgCommand;
emit appendText(cmd);
@ -789,14 +789,15 @@ bool Worker::execOpkgCommands() {
}
}
f.close();
if (!executeOpkgCommandFailed) {
if (opkgErrorLst.size() == 0) {
if (m_opkgCommands.size() > 0) {
m_displayIndex = 1;
GUI() << UPDATE_STEP::EXEC_OPKG_COMMAND_SUCCESS;
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_SUCCESS));
setProgress(_EXEC_OPKG_COMMAND_SUCCESS);
}
} else {
m_displayIndex = 1;
ISMAS(opkgErrorLst) << (GUI(opkgErrorLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_FAILURE));
GUI() << UPDATE_STEP::EXEC_OPKG_COMMAND_FAILURE;
setProgress(_EXEC_OPKG_COMMAND_FAILURE);
return false;