[PC-BSD Commits] r16242 - pcbsd/current/src-qt4/EasyPBI
svn at pcbsd.org
svn at pcbsd.org
Wed Apr 4 06:04:16 PDT 2012
Author: kenmoore
Date: 2012-04-04 13:04:16 +0000 (Wed, 04 Apr 2012)
New Revision: 16242
Modified:
pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
pcbsd/current/src-qt4/EasyPBI/modBuild.cpp
Log:
Fix a few small issues with EasyPBI, such as loading all the given make options when loading a pbi.conf if split between multiple lines.
Modified: pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp 2012-04-04 11:42:39 UTC (rev 16241)
+++ pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp 2012-04-04 13:04:16 UTC (rev 16242)
@@ -35,11 +35,7 @@
MainWindow::~MainWindow()
{
- // if (pbi_data)
- // {
- // Clean_Up(pbi_data, TRUE);
- // }
- //delete ui;
+
}
void MainWindow::slotSingleInstance(){
@@ -101,6 +97,8 @@
//file does not exist, copy the included resource to the file
qDebug() << "Copying the default icon to the EasyPBI directory";
QFile::copy(":/png/defaulticon.png",DEFAULTICON_FILE);
+
+ QFile::setPermissions(DEFAULTICON_FILE,QFile::ReadGroup | QFile::WriteGroup | QFile::ReadOwner | QFile::WriteOwner | QFile::ReadOther | QFile::WriteOther);
}
//Load the defaults for the PBI build settings
@@ -115,11 +113,6 @@
void MainWindow::Reset_Form()
{
- //if (pbi_data)
- //{
- //Clean_Up(pbi_data, TRUE);
- //pbi_data = NULL;
- //}
ui->port_name->setText("");
ui->port_category->setText("");
ui->author->setText("");
@@ -196,34 +189,6 @@
void MainWindow::on_create_button_clicked()
{
- /*char *home_dir;
- char original_dir[PATH_MAX];
-
- if (! pbi_data)
- {
- QMessageBox::about(this, tr("Error"), tr("Please push 'New Module' first."));
- return;
- }
- // find where we want to save the module
- ui->status_bar->setText(tr("Please wait while the module is created..."));
- // save text fields to data structure
- if (pbi_data->author_name) free(pbi_data->author_name);
- if (pbi_data->category) free(pbi_data->category);
- if (pbi_data->icon_name) free(pbi_data->icon_name);
- if (pbi_data->web_site) free(pbi_data->web_site);
- pbi_data->author_name = strdup( qPrintable(ui->author->text()));
- pbi_data->category = strdup( qPrintable(ui->port_category->text()));
- pbi_data->icon_name = strdup( qPrintable(ui->icon_path->text()));
- pbi_data->web_site = strdup( qPrintable(ui->website->text()));
- if( ui->gui_app->isChecked() ){pbi_data->console_app = FALSE;}
- else{pbi_data->console_app = TRUE;}
- // chdir to save location
- getcwd(original_dir, PATH_MAX);
- home_dir = getenv("HOME");
- chdir(home_dir);
- chdir("EasyPBI/Modules"); //Already exists (checked before now)
- */
-
// Build Module
bool success = FALSE;
ModBuild::makeStructs(ui->port_name->text(),ui->website->text(),ui->author->text(), \
@@ -777,43 +742,7 @@
//port: category/portname (example: www/firefox)
QStringList bins;
bins = ModBuild::getPortInfo(PORTS_DIR+"/"+port, "binaries");
- /* //Run Jesse's pbi.cpp code to find the binaries for a given port
- // -- create the new data structure
- PBI_Struct *new_pbi_data;
- char *argv[] = {"-9", "-s", ""};
- new_pbi_data = Init_Data();
- if (! new_pbi_data){
- QMessageBox::about(this, tr("Error"), tr("Could not set up memory for this module."));
- return bins;
- }
- // get the name, arguments
- QString portpath = PORTS_DIR+"/"+port;
- argv[2] = strdup(qPrintable(portpath));
- Get_Options(new_pbi_data, 3, argv);
- // confirm port exists
- bool status = Port_Exists(new_pbi_data);
- if (! status){
- qDebug() << "Find Binaries Error: port does not exist:"<<port;
- Clean_Up(new_pbi_data, TRUE);
- return bins;
- }
- new_pbi_data->console_app = FALSE;
- Get_Name(new_pbi_data);
- //Get_Category(new_pbi_data);
-
- // -- scan for executables and save them in the list
- BIN_FILE *current_exe;
- if(Get_Main_Exe_Smart(new_pbi_data) ){
- bins << new_pbi_data->main_exe;
- Get_More_Exe(new_pbi_data);
- current_exe = new_pbi_data->more_exe;
- while(current_exe){
- QString newEXE = "bin/"+QString(current_exe->path);
- if(!bins.contains(newEXE)){ bins << newEXE; }
- current_exe = (BIN_FILE *) current_exe->next;
- }
- }
-*/
+
return bins;
}
Modified: pcbsd/current/src-qt4/EasyPBI/modBuild.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/modBuild.cpp 2012-04-04 11:42:39 UTC (rev 16241)
+++ pcbsd/current/src-qt4/EasyPBI/modBuild.cpp 2012-04-04 13:04:16 UTC (rev 16242)
@@ -73,20 +73,44 @@
//Pull apart the variable and the value
QString var,val;
var = line.section("=",0,0,QString::SectionSkipEmpty).trimmed();
- val = line.section("=",1,50).section(";",0,0,QString::SectionSkipEmpty).trimmed().remove("\"");
+ val = line.section("=",1,50).section(";",0,0,QString::SectionSkipEmpty).trimmed();
//might need to add check for values that cross multiple lines later (mkStructure entries especially)
- if(var=="PBI_PROGNAME"){ progStruct[0] = val; }
- else if(var=="PBI_PROGWEB"){ progStruct[1] = val; }
- else if(var=="PBI_PROGAUTHOR"){ progStruct[2] = val; }
- else if(var=="PBI_PROGICON"){ progStruct[3] = val; }
- else if(var=="PBI_MAKEPORT"){ mkStruct[0] = val; }
- else if(var=="PBI_MKPORTBEFORE"){ mkStruct[1] = val; }
- else if(var=="PBI_MKPORTAFTER"){ mkStruct[2] = val; }
- else if(var=="PBI_MAKEOPTS"){ mkStruct[3] = val; }
- else if(var=="PBI_REQUIRESROOT"){ serverStruct[0] = val; }
- else if(var=="PBI_BUILDKEY"){ serverStruct[1] = val; }
- else if(var=="PBI_AB_PRIORITY"){ serverStruct[2] = val; }
- else if(var=="PBI_AB_NOTMPFS"){ serverStruct[3] = val; }
+ if(var=="PBI_PROGNAME"){ progStruct[0] = val.remove("\""); }
+ else if(var=="PBI_PROGWEB"){ progStruct[1] = val.remove("\""); }
+ else if(var=="PBI_PROGAUTHOR"){ progStruct[2] = val.remove("\""); }
+ else if(var=="PBI_PROGICON"){ progStruct[3] = val.remove("\""); }
+ else if(var=="PBI_MAKEPORT"){ mkStruct[0] = val.remove("\""); }
+ else if(var=="PBI_MKPORTBEFORE"){
+ QStringList tmpL = val.split(" ");
+ while( !val.simplified().endsWith("\"")){
+ val = in.readLine().section(";",0,0,QString::SectionSkipEmpty).simplified();
+ tmpL.append(val.split(" "));
+ }
+ val = tmpL.join(" ").remove("\""); //put the list back together
+ mkStruct[1] = val;
+ }
+ else if(var=="PBI_MKPORTAFTER"){
+ QStringList tmpL = val.split(" ");
+ while( !val.simplified().endsWith("\"")){
+ val = in.readLine().section(";",0,0,QString::SectionSkipEmpty).simplified();
+ tmpL.append(val.split(" "));
+ }
+ val = tmpL.join(" ").remove("\""); //put the list back together
+ mkStruct[2] = val;
+ }
+ else if(var=="PBI_MAKEOPTS"){
+ QStringList tmpL = val.split(" ");
+ while( !val.simplified().endsWith("\"")){
+ val = in.readLine().section(";",0,0,QString::SectionSkipEmpty).simplified();
+ tmpL.append(val.split(" "));
+ }
+ val = tmpL.join(" ").remove("\""); //put the list back together
+ mkStruct[3] = val;
+ }
+ else if(var=="PBI_REQUIRESROOT"){ serverStruct[0] = val.remove("\""); }
+ else if(var=="PBI_BUILDKEY"){ serverStruct[1] = val.remove("\""); }
+ else if(var=="PBI_AB_PRIORITY"){ serverStruct[2] = val.remove("\""); }
+ else if(var=="PBI_AB_NOTMPFS"){ serverStruct[3] = val.remove("\""); }
else{} //do nothing for extra lines
}
}
More information about the Commits
mailing list