Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some bugs doing freebsd-update / major updates via the GUI.

When an update is going to require a reboot, we must ensure the GUI
does NOT check for updates again, possibly trampling the freebsd-update
cache directories / files
  • Loading branch information...
commit 88de14c20275f4161bfdf21580d6a5d186eea8c3 1 parent b5dbe14
@kmoore134 kmoore134 authored
View
13 src-qt4/pc-systemupdatertray/UpdaterTray.cpp
@@ -337,9 +337,12 @@ void UpdaterTray::slotStartUpdateCheck()
qDebug() << "Starting System Update Check";
//Check for installed system updates needing computer to restart to finish
- bool needRestart = false;
- if( QFile::exists("/usr/local/tmp/update-stagedir/doupdate.sh") ){
- needRestart = true;
+ if ( QFile::exists("/tmp/.fbsdup-reboot") ) {
+ programstatus = SYSTEM_RESTART_NEEDED;
+ contextMenuRefresh();
+ displayTooltip();
+ doingCheck=false;
+ return;
}
bool haveUp = false;
@@ -432,9 +435,7 @@ void UpdaterTray::slotStartUpdateCheck()
}
/////////////////////////////////////////////
- if ( needRestart ) {
- programstatus = SYSTEM_RESTART_NEEDED;
- } else if ( haveUp ) {
+ if ( haveUp ) {
programstatus = SYSTEM_UPDATE_AVAIL;
} else if ( haveNGUp ) {
programstatus = PACKAGE_UPDATE_AVAIL;
View
12 src-qt4/pc-updategui/mainWin.cpp
@@ -238,6 +238,7 @@ void mainWin::slotUpdateLoop()
if ( wDir.isEmpty() ) {
if ( listUpdates.at(z).at(1) == "FBSDUPDATE" ) {
uProc->start("freebsd-update", QStringList() << "install");
+ system("touch /tmp/.fbsdup-reboot");
} else {
uProc->start("pc-updatemanager", QStringList() << "install" << tag );
}
@@ -356,6 +357,12 @@ void mainWin::slotRescanUpdates()
groupDetails->setVisible(false);
groupUpdates->setEnabled(false);
listUpdates.clear();
+
+ if ( QFile::exists("/tmp/.fbsdup-reboot") ) {
+ textLabel->setText(tr("Reboot required for update to finish!"));
+ return;
+ }
+
textLabel->setText(tr("Checking for updates... Please Wait..."));
slotReadUpdateData();
slotDisplayUpdates();
@@ -544,6 +551,11 @@ void mainWin::checkFBSDUpdates() {
QString line, toPatchVer, tmp;
QStringList up, listDesc, listPkgs;
+ if ( QFile::exists("/tmp/.fbsdup-reboot") ) {
+ qDebug() << "Skipping update check - Waiting for reboot";
+ return;
+ }
+
if ( QFile::exists("/tmp/.fbsdup-lock") ) {
qDebug() << "Skipping update check - freebsd-update is running elsewhere";
return;
View
3  src-sh/pc-updatemanager/pc-updatemanager
@@ -451,6 +451,9 @@ start_major_fbsd_update() {
exit_err "Failed running \"freebsd-update -r $rel upgrade\"..."
fi
+ # Touch our marker that we will need to reboot before doing other updates
+ touch /tmp/.fbsdup-reboot
+
# Now install freebsd-update files
freebsd-update --non-interactive install
if [ $? -ne 0 ] ; then
Please sign in to comment.
Something went wrong with that request. Please try again.