[PC-BSD Commits] r2790 - in pcbsd: branches/7.0/SystemUpdater trunk/SystemUpdater

svn at pcbsd.org svn at pcbsd.org
Thu Sep 18 08:46:40 PDT 2008


Author: kris
Date: 2008-09-18 08:46:39 -0700 (Thu, 18 Sep 2008)
New Revision: 2790

Modified:
   pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp
   pcbsd/trunk/SystemUpdater/UpdaterTray.cpp
Log:

Fixed up a few more bugs with updating, and a potential crash when an update fails to download. Will roll into online update later today.




Modified: pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp	2008-09-17 20:22:09 UTC (rev 2789)
+++ pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp	2008-09-18 15:46:39 UTC (rev 2790)
@@ -1050,6 +1050,13 @@
    UpdaterStatusDialog->setLabelSysUpdateStatus(status);
 
     UpdaterStatusDialog->setProgressTotalSteps(100);
+
+    // Make sure that any old patch is removed first
+    QFile tmpfile("/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma");
+    if ( tmpfile.exists() )
+    {
+      tmpfile.remove();
+    }
      
     copyJob = KIO::copy(SysUpdateURL[currentSysWorkingItem], "/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma", KIO::HideProgressInfo);
     
@@ -1119,8 +1126,11 @@
        if ( attemptedRedownload == 1 )
        {
 
+           // Show the updater status dialog, so user can see any errors
+           UpdaterStatusDialog->show();
 
            QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok );
+
            if ( UpdaterStatusDialog->isShown() )
            {
              UpdaterStatusDialog->hide();
@@ -1837,6 +1847,14 @@
    UpdaterStatusDialog->setLabelSysUpdateStatus(status);
 
     UpdaterStatusDialog->setProgressTotalSteps(100);
+
+    // Make sure that any old PBI is removed first
+    QFile tmpfile("/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi");
+    if ( tmpfile.exists() )
+    {
+      tmpfile.remove();
+    }
+     
     
     copyJob = KIO::copy(URL, "/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi", KIO::HideProgressInfo);
     

Modified: pcbsd/trunk/SystemUpdater/UpdaterTray.cpp
===================================================================
--- pcbsd/trunk/SystemUpdater/UpdaterTray.cpp	2008-09-17 20:22:09 UTC (rev 2789)
+++ pcbsd/trunk/SystemUpdater/UpdaterTray.cpp	2008-09-18 15:46:39 UTC (rev 2790)
@@ -1050,6 +1050,13 @@
    UpdaterStatusDialog->setLabelSysUpdateStatus(status);
 
     UpdaterStatusDialog->setProgressTotalSteps(100);
+
+    // Make sure that any old patch is removed first
+    QFile tmpfile("/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma");
+    if ( tmpfile.exists() )
+    {
+      tmpfile.remove();
+    }
      
     copyJob = KIO::copy(SysUpdateURL[currentSysWorkingItem], "/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma", KIO::HideProgressInfo);
     
@@ -1119,8 +1126,11 @@
        if ( attemptedRedownload == 1 )
        {
 
+           // Show the updater status dialog, so user can see any errors
+           UpdaterStatusDialog->show();
 
            QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok );
+
            if ( UpdaterStatusDialog->isShown() )
            {
              UpdaterStatusDialog->hide();
@@ -1837,6 +1847,14 @@
    UpdaterStatusDialog->setLabelSysUpdateStatus(status);
 
     UpdaterStatusDialog->setProgressTotalSteps(100);
+
+    // Make sure that any old PBI is removed first
+    QFile tmpfile("/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi");
+    if ( tmpfile.exists() )
+    {
+      tmpfile.remove();
+    }
+     
     
     copyJob = KIO::copy(URL, "/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi", KIO::HideProgressInfo);
     



More information about the Commits mailing list