Compare commits

..

No commits in common. "4e7ce2cd70f2bfb3b827e5d394de8e8293ec5f71" and "bdcb073bf81e68994bbcee2fb70b4692f00b6852" have entirely different histories.

3 changed files with 21 additions and 37 deletions

View File

@ -30,10 +30,6 @@ DEFINES += QT_DEPRECATED_WARNINGS
# git show origin/zg1/zone1 -s --format="c=%h m=%s d=%cI" # git show origin/zg1/zone1 -s --format="c=%h m=%s d=%cI"
# Use dynamic values for os-release and apism-version when sending # Use dynamic values for os-release and apism-version when sending
# last version info. # last version info.
# 1.3.10: Fix premature killing opkg-commands: detected timeout of 100s was
# too small when updating apism.
# Fix display of UPDATE_SUCCESS when opkg_command fails. Detected when
# updating apsim failed.
win32 { win32 {
BUILD_DATE=$$system("date /t") BUILD_DATE=$$system("date /t")
@ -43,7 +39,7 @@ win32 {
BUILD_TIME=$$system("date +%H:%M:%S") BUILD_TIME=$$system("date +%H:%M:%S")
} }
VERSION="1.3.10" VERSION="1.3.9"
INCLUDEPATH += plugins INCLUDEPATH += plugins

View File

@ -69,12 +69,8 @@ bool Command::execute(QString workingDirectory, QStringList args) {
qDebug() << "PROCESS" << m_command << "STARTED IN" << p->workingDirectory(); qDebug() << "PROCESS" << m_command << "STARTED IN" << p->workingDirectory();
if (p->state() == QProcess::ProcessState::Running) { if (p->state() == QProcess::ProcessState::Running) {
qDebug() << "PROCESS" << m_command << "RUNNING IN" << p->workingDirectory(); qDebug() << "PROCESS" << m_command << "RUNNING IN" << p->workingDirectory();
// wait forever for git/opkg-commands to finish // wait forever fot git-commands to finish
int wait = m_waitForFinishTimeout; int const wait = m_command.trimmed().startsWith("git", Qt::CaseInsensitive) ? -1 : m_waitForFinishTimeout;
if (m_command.trimmed().startsWith("git", Qt::CaseInsensitive) ||
m_command.trimmed().startsWith("opkg", Qt::CaseInsensitive)) {
wait = -1;
}
bool const no_timeout = p->waitForFinished(wait); bool const no_timeout = p->waitForFinished(wait);
if (no_timeout) { if (no_timeout) {
qDebug() << "PROCESS" << m_command << "FINISHED IN" << p->workingDirectory(); qDebug() << "PROCESS" << m_command << "FINISHED IN" << p->workingDirectory();

View File

@ -795,47 +795,39 @@ bool Worker::updateFiles(quint8 percent) {
if (f.exists()) { if (f.exists()) {
if (f.open(QIODevice::ReadOnly)) { if (f.open(QIODevice::ReadOnly)) {
QTextStream in(&f); QTextStream in(&f);
int cmdCount = 0;
QStringList opkgCommands; QStringList opkgCommands;
bool executeOpkgCommandFailed = false;
while (!in.atEnd()) { while (!in.atEnd()) {
QString line = in.readLine(); QString line = in.readLine();
static const QRegularExpression comment("^\\s*#.*$"); static const QRegularExpression comment("^\\s*#.*$");
if (line.indexOf(comment, 0) == -1) { if (line.indexOf(comment, 0) == -1) {
// found opkg command // found opkg command
QString opkgCommand = line.trimmed(); QString opkgCommand = line.trimmed();
if (!executeOpkgCommand(opkgCommand)) { ++cmdCount;
executeOpkgCommandFailed = true; executeOpkgCommand(opkgCommand);
} else { QString cmd = "\n " + opkgCommand;
QString cmd = "\n " + opkgCommand; emit appendText(cmd);
emit appendText(cmd); opkgCommands << cmd;
opkgCommands << cmd;
m_ismasClient.setProgressInPercent(++percent); m_ismasClient.setProgressInPercent(++percent);
m_updateStatus = UpdateStatus(UPDATE_STATUS::EXEC_OPKG_COMMAND, m_updateStatus = UpdateStatus(UPDATE_STATUS::EXEC_OPKG_COMMAND,
QString("EXEC OPKG-COMMAND ") + opkgCommand); QString("EXEC OPKG-COMMAND ") + opkgCommand);
IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT, IsmasClient::sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT,
QString("#M=APISM#C=CMD_EVENT#J=") + QString("#M=APISM#C=CMD_EVENT#J=") +
m_ismasClient.execOpkgCommand(m_updateStatus.m_statusDescription, "")); m_ismasClient.execOpkgCommand(m_updateStatus.m_statusDescription, ""));
}
} }
} }
f.close(); f.close();
if (!executeOpkgCommandFailed) { if (cmdCount > 0) {
if (opkgCommands.size() > 0) { m_displayIndex = 1;
m_displayIndex = 1; QString prepend = QString("(") + QString("%1").arg(m_displayIndex).rightJustified(3, ' ') + QString(")")
QString prepend = QString("(") + QString("%1").arg(m_displayIndex).rightJustified(3, ' ') + QString(")") + QString(" Update opkg pakets ... ");
+ QString(" Update opkg pakets ... "); opkgCommands.prepend(prepend);
opkgCommands.prepend(prepend); emit replaceLast(opkgCommands, UPDATE_STEP_DONE);
emit replaceLast(opkgCommands, UPDATE_STEP_DONE);
}
} else { } else {
m_displayIndex = 1; m_displayIndex = 1;
emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(3, ' ') + QString(")") emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(3, ' ') + QString(")")
+ QString(" Update opkg pakets ... "), UPDATE_STEP_FAIL); + QString(" Update opkg pakets ... "), UPDATE_STEP_FAIL);
stopProgressLoop();
setProgress(100);
return false;
} }
} }
} }