[PC-BSD Commits] r18584 - pcbsd/current/src-qt4/pc-sysmanager

svn at pcbsd.org svn at pcbsd.org
Thu Aug 23 12:03:43 PDT 2012


Author: kris
Date: 2012-08-23 19:03:42 +0000 (Thu, 23 Aug 2012)
New Revision: 18584

Removed:
   pcbsd/current/src-qt4/pc-sysmanager/cvsupprogress.cpp
   pcbsd/current/src-qt4/pc-sysmanager/cvsupprogress.h
   pcbsd/current/src-qt4/pc-sysmanager/cvsupprogress.ui
   pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.cpp
   pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.h
   pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.ui
Modified:
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui
   pcbsd/current/src-qt4/pc-sysmanager/pc-sysmanager.pro
   pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.cpp
   pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.h
Log:

Remove CVS gui's from system manager, and switch to "svn" now for
pulling FreeBSD sources. 



Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2012-08-23 18:06:34 UTC (rev 18583)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2012-08-23 19:03:42 UTC (rev 18584)
@@ -11,7 +11,6 @@
 *****************************************************************************/
 #include <qstring.h>
 #include <pcbsd-utils.h>
-#include <cvsupprogress.h>
 #include <qfiledialog.h>
 #include <QTextStream>
 #include <QNetworkAccessManager>
@@ -246,15 +245,15 @@
 
 void PBSystemTab::fetchSourcePressed()
 {
-    cvsUpUi = new CVSUpProgress();
-    cvsUpUi->setup(tr("System Source"), "/root/standard-supfile");
-    cvsUpUi->show();
+    portsnapUI = new PortsnapProgress();
+    portsnapUI->init(false, Version);
+    portsnapUI->show();
 }
 
 void PBSystemTab::fetchPortsPressed()
 {
     portsnapUI = new PortsnapProgress();
-    portsnapUI->init(false);
+    portsnapUI->init(true, Version);
     portsnapUI->show();
 }
 

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2012-08-23 18:06:34 UTC (rev 18583)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2012-08-23 19:03:42 UTC (rev 18584)
@@ -18,7 +18,6 @@
 #include "ui_pbsystemtab.h"
 #include "ui_dialogInfoBox.h"
 #include "portsnapprogress.h"
-#include "cvsupprogress.h"
 #include "dialogMetaProgress.h"
 #include "../config.h"
 
@@ -77,7 +76,6 @@
     void slotClose();
     
 private:
-    CVSUpProgress *cvsUpUi;
     QString KernDescr[50];
     QString KernDefaultTag;
     QString KernTag[50];

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui	2012-08-23 18:06:34 UTC (rev 18583)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui	2012-08-23 19:03:42 UTC (rev 18584)
@@ -787,7 +787,6 @@
   <include location="local">qmessagebox.h</include>
   <include location="local">qfile.h</include>
   <include location="local">qsettings.h</include>
-  <include location="local">cvsupprogress.h</include>
   <include location="local">portsnapprogress.h</include>
   <include location="global">qregexp.h</include>
   <include location="global">pcbsd-utils.h</include>

Modified: pcbsd/current/src-qt4/pc-sysmanager/pc-sysmanager.pro
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pc-sysmanager.pro	2012-08-23 18:06:34 UTC (rev 18583)
+++ pcbsd/current/src-qt4/pc-sysmanager/pc-sysmanager.pro	2012-08-23 19:03:42 UTC (rev 18584)
@@ -7,15 +7,13 @@
 
 INCLUDEPATH	+= ../libpcbsd/ /usr/local/include
 
-HEADERS	+= cvsupprogress.h fastestcvsup.h pbsystemtab.h portsnapprogress.h updaterDialog.h
+HEADERS	+= pbsystemtab.h portsnapprogress.h updaterDialog.h
 
-SOURCES	+= main.cpp cvsupprogress.cpp fastestcvsup.cpp pbsystemtab.cpp portsnapprogress.cpp updaterDialog.cpp
+SOURCES	+= main.cpp pbsystemtab.cpp portsnapprogress.cpp updaterDialog.cpp
 
 FORMS	= pbsystemtab.ui \
-	cvsupprogress.ui \
 	portsnapprogress.ui \
-	updaterDialog.ui \
-	fastestcvsup.ui
+	updaterDialog.ui
 
 RESOURCES = PBSystem.qrc 
 

Modified: pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.cpp	2012-08-23 18:06:34 UTC (rev 18583)
+++ pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.cpp	2012-08-23 19:03:42 UTC (rev 18584)
@@ -15,8 +15,19 @@
 #include <QDebug>
 #include <QDir>
 
-void PortsnapProgress::init(bool usingPortConsole)
+void PortsnapProgress::init(bool ports, QString pcVer)
 {
+    doPorts = ports;
+
+    if ( ports )
+       startPorts();
+    else
+       startSource(pcVer);
+
+}
+
+void PortsnapProgress::startPorts()
+{
     //Check our modified portsnap program is installed
     QFile newsnap("/usr/local/share/pcbsd/scripts/portsnap.sh");
     if (! newsnap.exists()) {
@@ -49,10 +60,7 @@
     
     //Init vars
     workdir = "/var/db/portsnap";
-    if (usingPortConsole)
-      portsdir = "/usr/jails/portjail/usr/ports";
-    else
-      portsdir = "/usr/ports";
+    portsdir = "/usr/ports";
 
     QDir checkdir;
     if ( ! checkdir.exists(portsdir) )
@@ -73,14 +81,39 @@
     connect(portsnap, SIGNAL(readyReadStandardOutput()), this, SLOT(parseFetch()));
     connect(portsnap, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(fetchDone()));
     portsnap->start(prog, args);
+
 }
 
+void PortsnapProgress::startSource(QString pcVer)
+{      
+    label->setText(tr("Downloading FreeBSD sources..."));
 
+    QString branch;
+    // Figure out which to download
+    if ( pcVer.indexOf(".") != -1 )
+       branch = "/releng/" + pcVer.section("-", 0, 0); 
+    else if ( pcVer.indexOf("STABLE") )
+       branch = "/stable/" + pcVer.section("-", 0, 0); 
+    else
+       branch = "/head";
+
+    QStringList args;
+    QString prog;
+    prog = "svn";
+    args << "co" << "svn://svn.freebsd.org/base" + branch << "/usr/src";
+    portsnap = new QProcess(this);
+    portsnap->setProcessChannelMode(QProcess::MergedChannels);
+    connect(portsnap, SIGNAL(readyReadStandardOutput()), this, SLOT(parseUpdate()));
+    connect(portsnap, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(fetchDone()));
+    portsnap->start(prog, args);
+}
+
+
 void PortsnapProgress::parseFetch()
 {
   while (portsnap->canReadLine() )
   {
-    QString output = portsnap->readLine();
+    QString output = portsnap->readLine().simplified();
     qDebug() << "Portsnap Fetch: " + output;
     taskProgressLbl->setText(displayString);
   }
@@ -113,6 +146,12 @@
     }
     else
     {
+
+        // If doing SVN, we can end now
+        if ( doPorts) {
+          updateDone();
+          return;
+        }
 	
         QStringList args;
         QString prog;
@@ -131,7 +170,7 @@
 {
   while( portsnap->canReadLine() )
   {
-    QString output = portsnap->readLine();
+    QString output = portsnap->readLine().simplified();
     qDebug() << "Portsnap Update: " + output;
     taskProgressLbl->setText(output);
   }

Modified: pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.h	2012-08-23 18:06:34 UTC (rev 18583)
+++ pcbsd/current/src-qt4/pc-sysmanager/portsnapprogress.h	2012-08-23 19:03:42 UTC (rev 18584)
@@ -17,7 +17,7 @@
           setupUi(this);
         }
 
-    void init(bool usingPortConsole);
+    void init(bool, QString);
 
 public slots:
 
@@ -29,12 +29,15 @@
     void updateDone();
 
 private:
+    void startPorts();
+    void startSource(QString);
     QProcess *portsnap;
     QString workdir;
     QString portsdir;
     QString displayString;
     int numberSteps;
     void finish();
+    bool doPorts;
 
 signals:
 



More information about the Commits mailing list