fix checkupdate and exit code
This commit is contained in:
@@ -26,8 +26,15 @@ void CheckUpdateManager::on_process_finished(int exit_code, QProcess::ExitStatus
|
|||||||
{
|
{
|
||||||
if (status == QProcess::CrashExit || (exit_code != 0 && exit_code != 2))
|
if (status == QProcess::CrashExit || (exit_code != 0 && exit_code != 2))
|
||||||
{
|
{
|
||||||
on_process_error(m_process.error());
|
QString reason;
|
||||||
return;
|
if (status == QProcess::CrashExit) reason = QStringLiteral("checkupdates: crashed");
|
||||||
|
|
||||||
|
const QString err = QString::fromUtf8(m_process.readAllStandardError()).trimmed();
|
||||||
|
const QString last = err.section(QLatin1Char('\n'), -1).trimmed();
|
||||||
|
reason = QStringLiteral("checkupdates: exit code %1").arg(exit_code);
|
||||||
|
if (!last.isEmpty()) reason += QStringLiteral(": ") + last;
|
||||||
|
emit add_log_line(reason);
|
||||||
|
emit finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString output = QString::fromUtf8(m_process.readAllStandardOutput());
|
const QString output = QString::fromUtf8(m_process.readAllStandardOutput());
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ void UpdateManager::set_package_manager(const QString& pm)
|
|||||||
void UpdateManager::on_update_ready_read()
|
void UpdateManager::on_update_ready_read()
|
||||||
{
|
{
|
||||||
const QByteArray chunk = m_process.readAllStandardOutput();
|
const QByteArray chunk = m_process.readAllStandardOutput();
|
||||||
// m_tail += chunk;
|
|
||||||
// if (m_tail.size() > 8192) m_tail = m_tail.right(8192);
|
|
||||||
emit append_update_log(chunk);
|
emit append_update_log(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +32,7 @@ void UpdateManager::on_process_finished(int exit_code, QProcess::ExitStatus stat
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString reason = QStringLiteral("exit code %1%2") .arg(exit_code);
|
const QString reason = QStringLiteral("exit code %1").arg(exit_code);
|
||||||
stop_update(false, reason);
|
stop_update(false, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user