[PC-BSD Commits] r591 - in pcbsd/trunk: kcmPBSystem system-overlay/PCBSD/Scripts/System

svn at pcbsd.org svn at pcbsd.org
Sun Aug 12 07:02:33 PDT 2007


Author: tim
Date: 2007-08-12 07:02:31 -0700 (Sun, 12 Aug 2007)
New Revision: 591

Modified:
   pcbsd/trunk/kcmPBSystem/fastestcvsup.ui
   pcbsd/trunk/kcmPBSystem/fastestcvsup.ui.h
   pcbsd/trunk/system-overlay/PCBSD/Scripts/System/fastest_cvsup
Log:
Fixed a couple of fastest_cvsup issues. Detect when no servers could be contacted & ensure all lines are read from STDOUT to avoid hanging.

Modified: pcbsd/trunk/kcmPBSystem/fastestcvsup.ui
===================================================================
--- pcbsd/trunk/kcmPBSystem/fastestcvsup.ui	2007-08-11 01:05:41 UTC (rev 590)
+++ pcbsd/trunk/kcmPBSystem/fastestcvsup.ui	2007-08-12 14:02:31 UTC (rev 591)
@@ -253,6 +253,7 @@
     <include location="global" impldecl="in declaration">klocale.h</include>
     <include location="global" impldecl="in declaration">qlistbox.h</include>
     <include location="global" impldecl="in declaration">qprocess.h</include>
+    <include location="global" impldecl="in declaration">kmessagebox.h</include>
     <include location="local" impldecl="in implementation">fastestcvsup.ui.h</include>
 </includes>
 <variables>

Modified: pcbsd/trunk/kcmPBSystem/fastestcvsup.ui.h
===================================================================
--- pcbsd/trunk/kcmPBSystem/fastestcvsup.ui.h	2007-08-11 01:05:41 UTC (rev 590)
+++ pcbsd/trunk/kcmPBSystem/fastestcvsup.ui.h	2007-08-12 14:02:31 UTC (rev 591)
@@ -69,29 +69,35 @@
     }
     
     connect(process, SIGNAL(readyReadStdout()), this, SLOT(readOutput()));
+    connect(process, SIGNAL(processExited()), this, SLOT(readOutput()));
     
+    qDebug("Executing: " + process->arguments().join(" "));
     process->start();
 }
 
 
 void FastestCvsup::readOutput()
 {
-    QString line = process->readLineStdout();
-    qWarning("Captured from stdout: " + line);
-    
-    QStringList list = QStringList::split(":", line);
-    if (list[0] == "Total") { progress->setTotalSteps(list[1].toInt() + 1); }
-    if (list[0] == "Testing")
+    while (process->canReadLineStdout())
     {
-	serverLbl->setText(list[1]);
-	progress->setProgress(progress->progress() + 1);
+	QString line = process->readLineStdout();
+	qWarning("Captured from stdout: " + line);
+	
+	QStringList list = QStringList::split(":", line);
+	if (list[0] == "Total") { progress->setTotalSteps(list[1].toInt() + 1); }
+	if (list[0] == "Testing")
+	{
+	    serverLbl->setText(list[1]);
+	    progress->setProgress(progress->progress() + 1);
+	}
+	if (list[0] == "Result")
+	{
+	    progress->setProgress(progress->totalSteps());
+	    if (list[1] == "FAILED") { KMessageBox::error(this, tr("Unable to reach any server. This could be because all selected servers are down, or because your internet connection is improperly configured.\n\nYou may wish to try testing other servers."), tr("Error")); }
+	    else { emit found(&list[1]); }
+	    close();
+	}
     }
-    if (list[0] == "Result")
-    {
-	progress->setProgress(progress->totalSteps());
-	emit found(&list[1]);
-	close();
-    }
 }
 
 

Modified: pcbsd/trunk/system-overlay/PCBSD/Scripts/System/fastest_cvsup
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Scripts/System/fastest_cvsup	2007-08-11 01:05:41 UTC (rev 590)
+++ pcbsd/trunk/system-overlay/PCBSD/Scripts/System/fastest_cvsup	2007-08-12 14:02:31 UTC (rev 591)
@@ -588,8 +588,13 @@
   }
 }
 else {
-  # we didn't get any servers, boo hoo. Send this to STDERR.
-  print STDERR $GENERAL_WARNING, "No servers were found :( \n";
+  if ( $MACHINE ) {
+    print "Result:FAILED\n";
+  }
+  else {
+    # we didn't get any servers, boo hoo. Send this to STDERR.
+    print STDERR $GENERAL_WARNING, "No servers were found :( \n";
+  }
   exit(1);
 }
 



More information about the Commits mailing list