[PC-BSD Commits] r2097 - pbibuild/pbi-source/PBIsource

svn at pcbsd.org svn at pcbsd.org
Fri Jun 13 08:46:45 PDT 2008


Author: kris
Date: 2008-06-13 08:46:44 -0700 (Fri, 13 Jun 2008)
New Revision: 2097

Modified:
   pbibuild/pbi-source/PBIsource/pbi.cpp
   pbibuild/pbi-source/PBIsource/pbi.h
   pbibuild/pbi-source/PBIsource/pbi.ui
Log:

Fixed up a slew of bugs with PBI installations on KDE4, should work properly
now



Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp	2008-06-12 18:55:13 UTC (rev 2096)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp	2008-06-13 15:46:44 UTC (rev 2097)
@@ -60,10 +60,8 @@
      
     CheckRoot = new QProcess(this);
     QString program = "whoami";
-    QStringList arguments;
-    arguments << ""; 
     connect(CheckRoot, SIGNAL( readyReadStandardOutput() ), this, SLOT(CheckRootSlot() ) );	   
-    CheckRoot->start(program, arguments);
+    CheckRoot->start(program);
 
     // Set the fixed size
     setFixedSize(490,310);
@@ -97,6 +95,7 @@
     setHelpEnabled(currentPage(), FALSE);
     helpButton()->setHidden(TRUE);
     
+
     if (PageName == tr("Welcome Screen") )
     {
          setNextEnabled(currentPage(), TRUE);
@@ -116,10 +115,11 @@
         // Check the lineInstallLocation and populate it if empty
         if ( lineInstallLocation->text().isEmpty() )
         {
-	    QDir DefaultDir;
-	    DefaultDir.setPath("/Programs/" + ProgDirName);
+	    //QDir DefaultDir;
+	    //DefaultDir.setPath("/Programs/" + ProgDirName);
 	    
-	    lineInstallLocation->setText(DefaultDir.canonicalPath());
+	    //lineInstallLocation->setText(DefaultDir.canonicalPath());
+	    lineInstallLocation->setText("/Programs/" + ProgDirName);
         }
  	
          // Check if this directory is valid and has enough space
@@ -129,7 +129,7 @@
         QStringList arguments;
         arguments << "checkdf.sh";
 
-         connect( StartDF, SIGNAL(processExited()), this, SLOT( slotCheckInstallLocation() ) ); 
+         connect( StartDF, SIGNAL( finished(int, QProcess::ExitStatus) ), this, SLOT( slotCheckLocationProcFinished(int, QProcess::ExitStatus) ) ); 
 
          StartDF->start(program, arguments);
 	//QMessageBox::information( this, tr("Error!"), tr("Error running startdf.sh Script! ") );
@@ -1085,8 +1085,9 @@
 
 void PBI::CheckRootSlot()
 {
-    
-       if (CheckRoot->readLine() != "root")
+ 	QString tmp = CheckRoot->readLine();
+ 
+       if (tmp.simplified() != "root")
       {
 	   if ( CLImode == 0)
 	   {
@@ -1144,8 +1145,9 @@
 }
 
 // Slot to grab the exit status of PBI.SetupScript.sh 
-void PBI:: slotSetupScriptFinished(int exitCode, QProcess::ExitStatus exitStatus)
+void PBI::slotSetupScriptFinished(int exitCode, QProcess::ExitStatus exitStatus)
 {
+ //QMessageBox::information( this, ProgramName,  "PBI.SetupScript.sh done!");
  slotSetupCustomRemoveScript();
 }
 
@@ -1154,14 +1156,17 @@
 {
     QString tmp;
     QString value;
-     while (UnTar->canReadLine() )
-     {	 // Read the line, sanitize it for display
+    UnTar->setReadChannel(QProcess::StandardError);
+    while (UnTar->canReadLine() )
+     {	 
+         // Read the line, sanitize it for display
 	 tmp = UnTar->readLine();
+	 tmp = tmp.simplified();
 	 if ( tmp.indexOf("x " ) == 0)
 	 {
 	       value = tmp.replace("x ", "");    
                  }
-	 value.truncate(50);
+	 value.truncate(48);
 	 progressTextDialog->setText(value);
 	 
 	 // Set the steps +1
@@ -1321,7 +1326,7 @@
          QFile file4( "extract.sh" );
          if ( file4.open( IO_WriteOnly ) ) {
                QTextStream stream4( &file4 );
-	       stream4 << "#!/bin/sh\nSKIP=`cat pbiskip`\ntail +${SKIP} pbilink | ./lzma d -si -so | tar xpov -C \"${1}\" -f - ";
+	       stream4 << "#!/bin/sh\nSKIP=`cat pbiskip`\ntail +${SKIP} pbilink | ./lzma d -si -so | tar xpov -C \"${1}\" -f -";
                  file4.close();
              }	
 	
@@ -1496,7 +1501,7 @@
     
      QString tmp;
      QString value;
-     while (SetupScript->canReadLine() );
+     while (SetupScript->canReadLine() )
      {	
 	 tmp = SetupScript->readLine();
 	 
@@ -2021,7 +2026,7 @@
          if ( file.open( IO_WriteOnly ) ) {
                QTextStream stream( &file );
 	       stream << "#!/bin/sh\n";
-               stream << "su " + RealUserName + " -c \"dcop klauncher klauncher 'exec_blind(QCString,QValueList<QCString>)' " + LaunchClose + " [ ]\"";
+               stream << "su " + RealUserName + " -c \"" + LaunchClose + "\"";
                  file.close();
          }	
 	system("chmod 755 postClose.sh" );
@@ -2031,6 +2036,11 @@
     exit(0);
 }
 
+void PBI::slotCheckLocationProcFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+  slotCheckInstallLocation();
+}
+
 // Check if the location we are installing to is valid, and enable / disable the Next button accordingly
 void PBI::slotCheckInstallLocation()
 {
@@ -2217,7 +2227,7 @@
 	     stream << "rm -rf '" + InstallDirPath + "'";
              file.close();
     }	
-     system("chmod 755 /Programs/" + ProgDirName + "/PBI.RemoveScript.sh" );
+    system("chmod 755 /Programs/" + ProgDirName + "/PBI.RemoveScript.sh" );
     
     FinishedInstallSlot();
 }
@@ -2270,17 +2280,18 @@
 	 // Read the line, then check if it is a match
 	tmp = ChecksumProc->readLine();
 	
-	 if ( tmp != ProgMD5 )
-              {
+	 if ( tmp.simplified() != ProgMD5 )
+         {
 	     ChecksumFinished = 0;
+	     QMessageBox::critical( this, "Data Integrity check failed!!", " -" + tmp.simplified() + "- != -" + ProgMD5 + "-");
 	     QMessageBox::critical( this, tr("Data integrity check failed!"), tr("ERROR: The internal data integrity check failed! The file is corrupt! "));
 	     exit(15);
-              } else {
+          } else {
 		  
 	     //QMessageBox::critical( this, "Data Integrity check Passed!", "YAY " + tmp + " = " + ProgMD5);
 	     ChecksumFinished = 0; 
 	     ChecksumPassed = 0;
-              }
+          }
      }
      
    }

Modified: pbibuild/pbi-source/PBIsource/pbi.h
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.h	2008-06-12 18:55:13 UTC (rev 2096)
+++ pbibuild/pbi-source/PBIsource/pbi.h	2008-06-13 15:46:44 UTC (rev 2097)
@@ -65,6 +65,7 @@
     void slotExtractProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
     void slotChecksumProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
     void readFirstRunOutput(int exitCode, QProcess::ExitStatus exitStatus);
+    void slotCheckLocationProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
 
 private:
     QString ProgramName;

Modified: pbibuild/pbi-source/PBIsource/pbi.ui
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.ui	2008-06-12 18:55:13 UTC (rev 2096)
+++ pbibuild/pbi-source/PBIsource/pbi.ui	2008-06-13 15:46:44 UTC (rev 2097)
@@ -56,14 +56,6 @@
    <bool>false</bool>
   </property>
   <widget class="QWidget" name="WizardPage" >
-   <property name="geometry" >
-    <rect>
-     <x>6</x>
-     <y>36</y>
-     <width>503</width>
-     <height>321</height>
-    </rect>
-   </property>
    <attribute name="title" >
     <string>Welcome Screen</string>
    </attribute>
@@ -934,6 +926,14 @@
    </layout>
   </widget>
   <widget class="QWidget" name="WizardPage" >
+   <property name="geometry" >
+    <rect>
+     <x>6</x>
+     <y>36</y>
+     <width>503</width>
+     <height>321</height>
+    </rect>
+   </property>
    <attribute name="title" >
     <string>Install Directory</string>
    </attribute>
@@ -1674,40 +1674,8 @@
    <attribute name="title" >
     <string>Install Finished</string>
    </attribute>
-   <layout class="QGridLayout" >
-    <item row="1" column="5" >
-     <spacer name="spacer24_3" >
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType" >
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>41</width>
-        <height>21</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="1" column="0" >
-     <spacer name="spacer25_3" >
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType" >
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>41</width>
-        <height>21</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="0" column="0" colspan="6" >
+   <layout class="QGridLayout" name="gridLayout" >
+    <item row="0" column="0" colspan="2" >
      <widget class="QLabel" name="headerPixmap4" >
       <property name="sizePolicy" >
        <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
@@ -1726,26 +1694,62 @@
       </property>
      </widget>
     </item>
-    <item row="1" column="1" colspan="4" >
-     <widget class="QLabel" name="textLabel5_2" >
-      <property name="frameShape" >
-       <enum>QFrame::NoFrame</enum>
-      </property>
-      <property name="frameShadow" >
-       <enum>QFrame::Plain</enum>
-      </property>
-      <property name="text" >
-       <string>&lt;b>&lt;font size="+1">Installation complete! &lt;/font>&lt;/b>&lt;br>&lt;br>Click "Finish" to exit.</string>
-      </property>
-      <property name="alignment" >
-       <set>Qt::AlignHCenter|Qt::AlignTop</set>
-      </property>
-      <property name="wordWrap" >
-       <bool>true</bool>
-      </property>
-     </widget>
+    <item row="1" column="0" colspan="2" >
+     <layout class="QHBoxLayout" name="horizontalLayout" >
+      <item>
+       <spacer name="spacer25_3" >
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType" >
+         <enum>QSizePolicy::Fixed</enum>
+        </property>
+        <property name="sizeHint" stdset="0" >
+         <size>
+          <width>41</width>
+          <height>21</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QLabel" name="textLabel5_2" >
+        <property name="frameShape" >
+         <enum>QFrame::NoFrame</enum>
+        </property>
+        <property name="frameShadow" >
+         <enum>QFrame::Plain</enum>
+        </property>
+        <property name="text" >
+         <string>&lt;b>&lt;font size="+1">Installation complete! &lt;/font>&lt;/b>&lt;br>&lt;br>Click "Finish" to exit.</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignHCenter|Qt::AlignTop</set>
+        </property>
+        <property name="wordWrap" >
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="spacer24_3" >
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType" >
+         <enum>QSizePolicy::Fixed</enum>
+        </property>
+        <property name="sizeHint" stdset="0" >
+         <size>
+          <width>41</width>
+          <height>21</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
     </item>
-    <item row="2" column="3" >
+    <item row="2" column="1" >
      <spacer name="spacer29_2" >
       <property name="orientation" >
        <enum>Qt::Vertical</enum>
@@ -1761,7 +1765,50 @@
       </property>
      </spacer>
     </item>
-    <item row="4" column="2" >
+    <item row="3" column="0" colspan="2" >
+     <layout class="QHBoxLayout" name="horizontalLayout_2" >
+      <item>
+       <spacer name="spacer31_4" >
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType" >
+         <enum>QSizePolicy::Expanding</enum>
+        </property>
+        <property name="sizeHint" stdset="0" >
+         <size>
+          <width>131</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="checkLaunch" >
+        <property name="text" >
+         <string>Start application when I click "Finish"</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="spacer32" >
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType" >
+         <enum>QSizePolicy::Expanding</enum>
+        </property>
+        <property name="sizeHint" stdset="0" >
+         <size>
+          <width>151</width>
+          <height>21</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </item>
+    <item row="4" column="0" >
      <spacer name="spacer30" >
       <property name="orientation" >
        <enum>Qt::Vertical</enum>
@@ -1777,45 +1824,6 @@
       </property>
      </spacer>
     </item>
-    <item row="3" column="2" colspan="2" >
-     <widget class="QCheckBox" name="checkLaunch" >
-      <property name="text" >
-       <string>Start application when I click "Finish"</string>
-      </property>
-     </widget>
-    </item>
-    <item row="3" column="0" colspan="2" >
-     <spacer name="spacer31_4" >
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType" >
-       <enum>QSizePolicy::Expanding</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>131</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="3" column="4" colspan="2" >
-     <spacer name="spacer32" >
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType" >
-       <enum>QSizePolicy::Expanding</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>151</width>
-        <height>21</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
    </layout>
   </widget>
  </widget>



More information about the Commits mailing list