From efb78c9627fd4911fe156d417d37793c059fe05f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 17 Jan 2017 09:49:26 -0500 Subject: [PATCH] Make sure the updatesAvailable flag does not get saved if there was a network error during the check, --- src/server/library/sysadm-update.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/library/sysadm-update.cpp b/src/server/library/sysadm-update.cpp index 8235626..8646246 100644 --- a/src/server/library/sysadm-update.cpp +++ b/src/server/library/sysadm-update.cpp @@ -80,7 +80,9 @@ QJsonObject Update::checkUpdates(bool fast) { //qDebug() << " - Run full check"; //output = General::RunCommand("pc-updatemanager check").split("\n"); output.append( General::RunCommand("pc-updatemanager pkgcheck").split("\n") ); - General::writeTextFile(UP_UPFILE, output); //save this check for later "fast" updates + if(!output.last().contains("ERROR:")){ //make sure there was network access available first - otherwise let it try again soon + General::writeTextFile(UP_UPFILE, output); //save this check for later "fast" updates + } } //qDebug() << "pc-updatemanager checks:" << output;