Changeset c6b6d5e


Ignore:
Timestamp:
12/27/13 08:14:23 (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
b373d06
Parents:
3fb472a
Message:

Fix up the wrapper-script generator in EasyPBI

Location:
src-qt4/EasyPBI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI/ModuleUtils.cpp

    rebba654 rc6b6d5e  
    213213  return cmd; 
    214214} 
     215 
     216QStringList ModuleUtils::generateWrapperScriptTemplate(){ 
     217  QStringList out; 
     218        out <<"#!/bin/sh"; 
     219        out << "#This is a sample wrapper script form generated by EasyPBI"; 
     220        out << "# REMINDER: Add this file to the external-links for the PBI as well!"; 
     221        out << ""; 
     222        out << "#Setup some internal script variables"; 
     223        out << "PROGDIR=`pwd | cut -d / -f 1-4`   #Base PBI directory (/usr/pbi/myapplication-<arch>)"; 
     224        out << "APPBINARY=bin/SAMPLE   #application binary"; 
     225        out << ""; 
     226        out << "#--- DO SOMETHING HERE ---"; 
     227        out << ""; 
     228        out << "#Now start the main application"; 
     229        out << "${PROGDIR}/${APPBINARY} $@"; 
     230         
     231  return out; 
     232} 
  • src-qt4/EasyPBI/ModuleUtils.h

    rebba654 rc6b6d5e  
    3131        static PBIModule newModule(QString moduleDir, QString port, QString iconFile); 
    3232        static QString generatePbiBuildCmd(QString confDir, QString outDir, QString sigFile); 
     33        static QStringList generateWrapperScriptTemplate(); 
    3334 
    3435}; 
  • src-qt4/EasyPBI/PBIModule.cpp

    rfb2cffd rc6b6d5e  
    674674    out << dir.entryList(QDir::Files | QDir::NoDotAndDotDot,QDir::Name); 
    675675    for(int i=0; i<subdirs.length(); i++){ 
    676       out << filesInDir(dirPath+"/"+subdirs[i]); 
    677     } 
     676      QStringList subFiles = filesInDir(dirPath+"/"+subdirs[i]); 
     677      for(int j=0; j<subFiles.length(); j++){ 
     678        //Make sure to prepend the subdirectory name 
     679        out << subdirs[i]+"/"+subFiles[j]; 
     680      } 
     681  } 
    678682  } 
    679683  return out;    
  • src-qt4/EasyPBI/mainGUI.cpp

    rfb2cffd rc6b6d5e  
    688688  //Check for a valid input 
    689689  if(!ok || cFile.isEmpty()){ return; } 
     690  if(!cFile.endsWith(".sh")){ cFile.append(".sh"); } 
    690691  //Now create the new file 
    691   //currentModule->addResource(TRUE,cFile); 
    692   qDebug() << "Creating default wrapper script is not implemented currently"; 
     692  MODULE.createFile(MODULE.basepath()+"/resources/bin/"+cFile, ModuleUtils::generateWrapperScriptTemplate()); 
    693693  //Refresh the GUI 
    694694  refreshGUI("resources"); 
Note: See TracChangeset for help on using the changeset viewer.