[PC-BSD Commits] r20785 - users/ken/EasyPBI2

svn at pcbsd.org svn at pcbsd.org
Thu Dec 27 15:27:09 PST 2012


Author: kenmoore
Date: 2012-12-27 23:27:09 +0000 (Thu, 27 Dec 2012)
New Revision: 20785

Modified:
   users/ken/EasyPBI2/modBuild.cpp
   users/ken/EasyPBI2/portsDialog.cpp
Log:
Some polishing for EasyPBI2, the default wrapper scripts are now much nicer and also get portsnap working non-interactively (almost)



Modified: users/ken/EasyPBI2/modBuild.cpp
===================================================================
--- users/ken/EasyPBI2/modBuild.cpp	2012-12-27 19:41:43 UTC (rev 20784)
+++ users/ken/EasyPBI2/modBuild.cpp	2012-12-27 23:27:09 UTC (rev 20785)
@@ -758,9 +758,11 @@
     //Create a standard wrapper script in the module
     QStringList form;
     form << "#!/bin/sh";
-    form << "#This is a sample wrapper script form layout";
-    form << "PROGDIR=CHANGEME   #this will point to the base PBI directory";
-    form << "APPBINARY=bin/sample #application binarn";
+    form << "#This is a sample wrapper script form generated by EasyPBI";
+    form << "# REMINDER: Add this file to the external-links for the PBI as well!";
+    form << "\n#Setup some internal script variables";
+    form << "PROGDIR=`pwd | cut -d / -f 1-4` #Base PBI directory (/usr/pbi/myapplication-<arch>)";
+    form << "APPBINARY=bin/sample #application binary";
     form << "#--- DO SOMETHING HERE ---\n";
     form << "#Now start the main application";
     form << "${PROGDIR}/${APPBINARY} $@";

Modified: users/ken/EasyPBI2/portsDialog.cpp
===================================================================
--- users/ken/EasyPBI2/portsDialog.cpp	2012-12-27 19:41:43 UTC (rev 20784)
+++ users/ken/EasyPBI2/portsDialog.cpp	2012-12-27 23:27:09 UTC (rev 20785)
@@ -107,12 +107,17 @@
   ui->progressBar->setMaximum(0); ui->progressBar->setMinimum(0); //default to a "loading" indicator
   ui->label_status->setText(tr("Requesting Root Access"));
   QString cmd = suCMD + " \""; //use the swutch-user utility
+  QString portsnapNonInteractive = "cat /usr/sbin/portsnap | sed 's|! -t 0|-z '1'|g' | /bin/sh -s";
   if(systemPorts){
-    //Update the ports tree
-    cmd.append("svn update /usr/ports");
+    //Update the ports tree	  
+    if( QFile::exists("/usr/ports/.svn") ){
+      cmd.append("svn update /usr/ports");
+    }else{
+      cmd.append(portsnapNonInteractive + " fetch update");
+    }
   }else{
     //Fresh installation of the ports tree
-    cmd.append("svn co svn://svn.freebsd.org/ports/head /usr/ports");
+    cmd.append(portsnapNonInteractive + " fetch extract");
   }
   cmd.append("\""); //close the quotes
   //Now run the command



More information about the Commits mailing list