Changeset df413956


Ignore:
Timestamp:
12/16/13 10:15:32 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
c8639a2
Parents:
9809371 (diff), e5cbe5c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI-devel/Makefile

    rc8de217 re5cbe5c  
    11############################################################################# 
    22# Makefile for building: EasyPBI 
    3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Fri Dec 13 21:15:29 2013 
     3# Generated by qmake (2.01a) (Qt 4.8.5) on: Mon Dec 16 10:44:43 2013 
    44# Project:  EasyPBI.pro 
    55# Template: app 
     
    225225                PBIModule.h \ 
    226226                ModuleUtils.h \ 
     227                pkgSelect.h \ 
    227228                mainGUI.h 
    228229        /usr/local/bin/moc-qt4 $(DEFINES) $(INCPATH) mainGUI.h -o moc_mainGUI.cpp 
     
    230231moc_newModuleDialog.cpp: ui_newModuleDialog.h \ 
    231232                backend.h \ 
     233                pkgSelect.h \ 
    232234                newModuleDialog.h 
    233235        /usr/local/bin/moc-qt4 $(DEFINES) $(INCPATH) newModuleDialog.h -o moc_newModuleDialog.cpp 
     
    304306                config.h \ 
    305307                PBIModule.h \ 
    306                 ModuleUtils.h 
     308                ModuleUtils.h \ 
     309                pkgSelect.h 
    307310        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp 
    308311 
     
    313316                PBIModule.h \ 
    314317                ModuleUtils.h \ 
     318                pkgSelect.h \ 
    315319                ui_mainGUI.h \ 
    316320                newModuleDialog.h \ 
     
    330334newModuleDialog.o: newModuleDialog.cpp newModuleDialog.h \ 
    331335                ui_newModuleDialog.h \ 
    332                 backend.h 
     336                backend.h \ 
     337                pkgSelect.h 
    333338        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o newModuleDialog.o newModuleDialog.cpp 
    334339 
  • src-qt4/EasyPBI-devel/PBIModule.cpp

    rcbead0d1 re5cbe5c  
    600600   
    601601  //Check that the parent directory exists, and create it if necessary 
    602   QDir dir(fileName); 
    603     dir.cdUp(); 
     602  QString pDir = fileName; 
     603  pDir.chop( fileName.section("/",-1).length() ); 
     604  QDir dir(pDir); 
    604605    if(!dir.exists()){  
     606      qDebug() << "Create parent Directory:" << dir.absolutePath(); 
    605607      if( !dir.mkpath(dir.absolutePath()) ){ 
    606608        qDebug() << fileName+": Could not create containing directory"; 
  • src-qt4/EasyPBI-devel/preferencesDialog.cpp

    r4071b4d re5cbe5c  
    2626        settings->scanForExternalUtilities();    
    2727        settings->loadSettingsFile(); 
    28         //initialize the QProcess 
    29         /*process = new QProcess(this); 
    30         process->setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); 
    31         connect(process,SIGNAL(readyReadStandardOutput()),this,SLOT(updateStatusBar()) ); 
    32         connect(process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus)) ); 
    33         *///Put the current settings into the GUI 
     28         
     29        //Put the current settings into the GUI 
    3430        resetGUI(); 
    3531} 
     
    5652        ui->line_pbicreate->setText(settings->value("pbi_create")); 
    5753        ui->line_makeport->setText(settings->value("pbi_makeport")); 
    58         /*//ports tab 
    59         ui->list_portsDirectories->clear(); 
    60         QStringList pDirs; pDirs<< tr("Current User (~/EasyPBI/ports)") << tr("All Users (/usr/ports)") << tr("Other"); 
    61         ui->list_portsDirectories->addItems(pDirs); 
    62         QString portsdir = settings->value("portsdir"); 
    63         if(portsdir.endsWith("/")){ portsdir.chop(1); } 
    64         if(portsdir == (QDir::homePath()+"/EasyPBI/ports") ){ 
    65           ui->list_portsDirectories->setCurrentIndex(0); //User dir 
    66         }else if(portsdir == "/usr/ports"){ 
    67           ui->list_portsDirectories->setCurrentIndex(1); //system dir    
    68         }else{ 
    69           ui->list_portsDirectories->setCurrentIndex(2); //other 
    70           ui->line_otherPortsDir->setText(portsdir); 
    71         } 
    72         ui->progressBar->setMaximum(0); ui->progressBar->setMinimum(0); //default to a "loading" indicator 
    73         */updateGUI(); 
     54        updateGUI(); 
    7455} 
    7556 
     
    8162        if( ui->check_usepkgcache->isChecked() ){ ui->groupBox_pkgcache->setVisible(TRUE); } 
    8263        else{ ui->groupBox_pkgcache->setVisible(FALSE); } 
    83         /*//ports tab 
    84         int pIndex = ui->list_portsDirectories->currentIndex(); 
    85         if(pIndex == 2){ 
    86           ui->line_otherPortsDir->setVisible(TRUE); ui->tool_otherPortsDir->setVisible(TRUE); 
    87         }else{ 
    88           ui->line_otherPortsDir->setVisible(FALSE); ui->tool_otherPortsDir->setVisible(FALSE);  
    89         } 
    90         QString pDir; 
    91         switch (pIndex){ 
    92         case 0:  
    93                 pDir = QDir::homePath()+"/EasyPBI/ports"; break; 
    94         case 1: 
    95                 pDir = "/usr/ports"; break; 
    96         default: 
    97                 pDir = ui->line_otherPortsDir->text(); 
    98         }        
    99         QString pUpdate; 
    100         if(!pDir.isEmpty()){ pUpdate = getLastPortsUpdate(pDir); } //check for existance and last update 
    101         if( !pUpdate.isEmpty() ){ 
    102           ui->push_fetchPorts->setVisible(FALSE); 
    103           ui->push_updatePorts->setVisible(TRUE); 
    104           ui->label_portsUpdated->setText( pUpdate ); 
    105         }else{ 
    106           ui->push_fetchPorts->setVisible(TRUE); 
    107           ui->push_updatePorts->setVisible(FALSE); 
    108           ui->label_portsUpdated->setText( tr("Nonexistent") ); 
    109         } 
    110         if(process->state() == QProcess::NotRunning){ 
    111           ui->list_portsDirectories->setEnabled(TRUE); 
    112           ui->line_otherPortsDir->setEnabled(TRUE); ui->tool_otherPortsDir->setEnabled(TRUE); 
    113           ui->label_status->setVisible(FALSE); ui->progressBar->setVisible(FALSE); 
    114           ui->push_fetchPorts->setEnabled(TRUE); ui->push_updatePorts->setEnabled(TRUE); 
    115           ui->buttonBox->setEnabled(TRUE); 
    116         }else{ 
    117           ui->list_portsDirectories->setEnabled(FALSE); 
    118           ui->line_otherPortsDir->setEnabled(FALSE); ui->tool_otherPortsDir->setEnabled(FALSE); 
    119           ui->label_status->setVisible(TRUE); ui->progressBar->setVisible(TRUE); 
    120           ui->push_fetchPorts->setEnabled(FALSE); ui->push_updatePorts->setEnabled(FALSE); 
    121           ui->buttonBox->setEnabled(FALSE); 
    122         } 
    123         */ 
    12464} 
    12565 
     
    13878    badpkgs.removeDuplicates(); 
    13979    settings->setList("skippkgs", badpkgs); 
    140     /*QString portsDir; 
    141     int pIndex = ui->list_portsDirectories->currentIndex(); 
    142     if( pIndex == 0 ){portsDir = QDir::homePath()+"/EasyPBI/ports"; } 
    143     else if( pIndex == 1){ portsDir = "/usr/ports"; } 
    144     else{ portsDir = ui->line_otherPortsDir->text(); }     
    145     settings->setValue("portsdir", portsDir ); */ 
    14680    settings->setValue("moduledir", ui->line_moduledir->text() ); 
    14781    settings->setValue("icondir", ui->line_icondir->text() ); 
     
    290224  ui->line_makeport->setText(settings->value("pbi_makeport")); 
    291225} 
    292  
    293 // ======  Ports Tab ====== 
    294 /* 
    295 void PreferencesDialog::on_list_portsDirectories_currentIndexChanged(int index){ 
    296   index = 0; //Remove compiler warning about unused variable 
    297   updateGUI();   
    298 } 
    299  
    300 void PreferencesDialog::on_line_otherPortsDir_textChanged(QString text){ 
    301   text.clear(); //Remove compiler warning about unused variable 
    302   updateGUI();   
    303 } 
    304 void PreferencesDialog::on_tool_otherPortsDir_clicked(){ 
    305   //Get the desired directory 
    306   QString seldir = QFileDialog::getExistingDirectory(this, tr("Select FreeBSD Ports Directory"), QDir::homePath() ); 
    307   if(seldir.isEmpty()){ return; } //action cancelled 
    308   //Save the selection to the GUI 
    309   ui->line_otherPortsDir->setText(seldir); 
    310   updateGUI(); 
    311 } 
    312  
    313 void PreferencesDialog::on_push_fetchPorts_clicked(){ 
    314   int pIndex = ui->list_portsDirectories->currentIndex(); 
    315   QString pDir; 
    316     if( pIndex == 0 ){pDir = QDir::homePath()+"/EasyPBI/ports"; } 
    317     else if( pIndex == 1){ pDir = "/usr/ports"; } 
    318     else{ pDir = ui->line_otherPortsDir->text(); } 
    319   fetchPorts(pDir,TRUE); //is a new ports directory 
    320   updateGUI(); 
    321 } 
    322  
    323 void PreferencesDialog::on_push_updatePorts_clicked(){ 
    324   int pIndex = ui->list_portsDirectories->currentIndex(); 
    325   QString pDir; 
    326     if( pIndex == 0 ){pDir = QDir::homePath()+"/EasyPBI/ports"; } 
    327     else if( pIndex == 1){ pDir = "/usr/ports"; } 
    328     else{ pDir = ui->line_otherPortsDir->text(); } 
    329   fetchPorts(pDir,FALSE); //is an existing ports directory 
    330   updateGUI(); 
    331 } 
    332      
    333 void PreferencesDialog::updateStatusBar(){ 
    334   QString tmp = process->readAllStandardOutput(); 
    335   if(tmp.endsWith("\n")){ tmp.chop(1); } 
    336   tmp = tmp.section("\n",-1); 
    337   tmp = tmp.remove("\n").simplified(); 
    338   //qDebug() << "Status Update:" << tmp; 
    339   ui->label_status->clear(); 
    340   ui->label_status->setText(tmp); 
    341 } 
    342  
    343 void PreferencesDialog::processFinished(int exitCode,QProcess::ExitStatus status){ 
    344   qDebug() << " - Ports update finished:" << exitCode << status; 
    345   //Inform the user of the result 
    346   if(exitCode == 0){ 
    347     //Finished successfully 
    348     QMessageBox::information(this, tr("Success"), tr("The FreeBSD ports tree has been successfully updated") ); 
    349   }else{ 
    350     //Finished with error 
    351     QString msg = process->readAllStandardError(); 
    352     if(msg.isEmpty()){ msg = process->readAllStandardOutput(); } 
    353     QMessageBox::information(this, tr("Failure"), QString(tr("The FreeBSD ports tree has failed to update.")+"\n"+tr("Last Message: %1") ).arg(msg) ); 
    354   } 
    355   updateGUI(); //Update the interface times and such 
    356 } 
    357  
    358 QString PreferencesDialog::getLastPortsUpdate(QString ports){ 
    359   QDir dir(ports); 
    360   QFileInfoList list = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs, QDir::Time); //sort by most recently changed 
    361   QString out; 
    362   if(list.length() > 2){ //good ports tree 
    363     out = list[0].lastModified().toString(); 
    364   } 
    365   return out; 
    366 } 
    367  
    368 void PreferencesDialog::fetchPorts(QString portsDir, bool isNew){ 
    369   bool needRoot = TRUE; 
    370   QString localPSDB = QDir::homePath()+"/EasyPBI/.portSnapDB"; 
    371   if( portsDir.startsWith( QDir::homePath() )){ needRoot = FALSE; } 
    372    
    373   // == Generate the System Command == 
    374   QString cmd; 
    375   bool usePortsnap = FALSE; 
    376   //Graphical SU utility as needed 
    377   if(needRoot){  
    378     ui->label_status->setText(tr("Requesting Root Access")); //Put placeholder info 
    379     cmd = ui->line_suutility->text() + " \""; //use the switch-user utility 
    380   } 
    381   //Figure out whether to use portsnap or not 
    382   if( !isNew && QFile::exists(portsDir+"/.svn") ){ 
    383     //Use Subversion 
    384     cmd.append("svn update "+portsDir); 
    385   }else{ 
    386     //Use Portsnap 
    387     cmd.append("portsnap fetch "); 
    388     if(isNew){ cmd.append("extract "); } 
    389     else{ cmd.append("update "); } 
    390     cmd.append("-p "+portsDir); 
    391     if(!needRoot){ cmd.append(" -d "+localPSDB); } 
    392     usePortsnap=TRUE; 
    393      
    394   } 
    395   if(needRoot){ cmd.append("\""); } //close the quotes 
    396    
    397   //If using portsnap, make sure the intermediate file is there in the EasyPBI directory 
    398   if( usePortsnap ){ 
    399     QString pspath = QDir::homePath()+"/EasyPBI/.portsnapNI.sh"; // Non-Interactive (NI) version of portsnap 
    400     if( !QFile::exists(pspath) ){ 
    401       //Create the Non-Interactive version of portsnap if it does not exist yet 
    402       QString pscmd ="echo \"#!/bin/sh \n#Non-Interactive portsnap workaround for EasyPBI \ncat /usr/sbin/portsnap | sed 's|! -t 0|-z '1'|g' | /bin/sh -s \\$@\" > "+pspath+"; chmod 755 "+pspath; 
    403       //qDebug() << "system call:" << pscmd; 
    404       system(pscmd.toUtf8()); 
    405     } 
    406     if(!needRoot && !QFile::exists(localPSDB)){ 
    407       //Create the local portsnap database directory 
    408       QString tmpcmd = "mkdir "+localPSDB; 
    409       system(tmpcmd.toUtf8()); 
    410     } 
    411     cmd.replace("portsnap",pspath); 
    412   } 
    413   //Now run the command 
    414   process->start(cmd); 
    415   qDebug() << "Ports fetch started: CMD:" << cmd;        
    416 }*/ 
    417  
  • src-qt4/EasyPBI-devel/preferencesDialog.h

    r3038c71 re5cbe5c  
    4848    void on_push_makeport_clicked(); 
    4949    void on_push_resetutils_clicked(); 
    50     //Ports Tab 
    51     void on_list_portsDirectories_currentIndexChanged(int); 
    52     void on_line_otherPortsDir_textChanged(QString); 
    53     void on_tool_otherPortsDir_clicked(); 
    54     void on_push_fetchPorts_clicked(); 
    55     void on_push_updatePorts_clicked(); 
    56     void updateStatusBar(); 
    57     void processFinished(int,QProcess::ExitStatus); 
    58      
     50 
    5951 
    6052private: 
    6153    Ui::PreferencesDialog *ui; 
    6254    Config *settings; 
    63     QProcess *process; 
    64      
    65     QString getLastPortsUpdate(QString); 
    66     void fetchPorts(QString, bool); 
    6755 
    6856}; 
  • src-qt4/pc-pkgmanager/mainWin.cpp

    r8c6e16d r9809371  
    357357  qDebug() << cmd + " " + flags.join(" "); 
    358358 
     359  system("rm /tmp/pkg-fifo 2>/dev/null"); 
     360 
    359361  // Create the EVENT_PIPE 
    360362  if ( wDir.isEmpty() ) 
    361     system("mkfifo /tmp/pkg-fifo"); 
     363    system("mkfifo /tmp/pkg-fifo ; sleep 1"); 
    362364  else 
    363     system("mkfifo " + wDir.toLatin1() + "/tmp/pkg-fifo"); 
     365    system("mkfifo " + wDir.toLatin1() + "/tmp/pkg-fifo ; sleep 1"); 
    364366 
    365367  // Open and connect the EVENT_PIPE 
    366368  eP = new QProcess(); 
    367   connect( eP, SIGNAL(readyReadStandardOutput()), this, SLOT(slotReadEventPipe()) ); 
    368   eP->start(QString("tail"), QStringList() << "-f" << wDir + "/tmp/pkg-fifo"); 
    369   qDebug() << "Starting EVENT_PIPE" << wDir + "/tmp/pkg-fifo"; 
    370    
     369  eP->setProcessChannelMode(QProcess::MergedChannels); 
     370  connect( eP, SIGNAL(readyRead()), this, SLOT(slotReadEventPipe()) ); 
     371  connect( eP, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotReadEventPipe()) ); 
     372  eP->start(QString("cat"), QStringList() << "-u" << wDir + "/tmp/pkg-fifo"); 
     373  qDebug() << "Starting EVENT_PIPE"; 
     374  eP->waitForStarted(); 
     375 
    371376  // Setup the first process 
    372377  uProc = new QProcess(); 
    373378  QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); 
    374379  env.insert("PCFETCHGUI", "YES"); 
    375  
    376   // KPM 12-12-2013 
    377   // EVENT_PIPE causes segfaults in pkgng 1.2.3 :( 
    378   // Re-enable this when its fixed upstream 
    379   //env.insert("EVENT_PIPE", "/tmp/pkg-fifo"); 
    380  
     380  env.insert("EVENT_PIPE", "/tmp/pkg-fifo"); 
    381381  uProc->setProcessEnvironment(env); 
    382382  uProc->setProcessChannelMode(QProcess::MergedChannels); 
     
    950950  pCmds.clear(); 
    951951 
     952  // Adding packages 
    952953  if ( ! pkgAddList.isEmpty() ) { 
     954 
     955    // Look for conflicts first 
     956    if ( wDir.isEmpty() ) 
     957      pCmds << "pc-pkg" << "check-conflict" << pkgAddList.join(" "); 
     958    else 
     959      pCmds << "chroot" << wDir << "pc-pkg" << "check-conflict" << pkgAddList.join(" "); 
     960    pkgCmdList << pCmds; 
     961    pCmds.clear(); 
     962 
     963    // Now spin up the install process 
    953964    if ( wDir.isEmpty() ) 
    954965      pCmds << "pc-pkg" << "install" << "-y" << pkgAddList.join(" "); 
    955966    else 
    956967      pCmds << "chroot" << wDir << "pc-pkg" << "install" << "-y" << pkgAddList.join(" "); 
     968 
    957969    pkgCmdList << pCmds; 
    958970  } 
     
    15051517{ 
    15061518   QString line, tmp, file, dl, tot; 
     1519   bool ok, ok2; 
    15071520 
    15081521   while (eP->canReadLine()) { 
    15091522     line = eP->readLine().simplified(); 
    1510      qDebug() << line; 
     1523     //qDebug() << line; 
    15111524 
    15121525     // KPM!! 
     
    15391552          dl = line.section(":", 2, 2).section(",", 0, 0); 
    15401553          tot = line.section(":", 3, 3).section("}", 0, 0); 
     1554          dl = dl.simplified(); 
     1555          tot = tot.simplified(); 
     1556 
     1557          dl.toLongLong(&ok); 
     1558          tot.toLongLong(&ok2); 
     1559          if ( ok && ok2) { 
     1560            progressUpdate->setRange(0, tot.toLongLong(&ok) / 1024); 
     1561            progressUpdate->setValue(dl.toLongLong(&ok) / 1024 ); 
     1562          } 
    15411563 
    15421564          // Set the status update 
    1543           textStatus->setText(tr("Downloading") + " " + file + " (" + dl + "/" + tot + ")" ); 
     1565          textStatus->setText(tr("Downloading") + " " + file + " (" + dl + " / " + tot + ")" ); 
    15441566     } 
    15451567 
    15461568   } // End of while canReadLine() 
    1547 } 
     1569 
     1570} 
  • src-sh/pc-metapkgmanager/pc-metapkgmanager

    r8506de1f r9809371  
    8181        fi 
    8282 
     83        # Don't need this anymore 
     84        unset EVENT_PIPE 
     85 
    8386        # Time to run pkgng and let it install packages! 
    8487        pkg install -yUf "$pkgName" 
     
    279282} 
    280283 
     284do_pkg_conflicts() 
     285{ 
     286   fullopts="`echo $@ | sed 's|check-conflict||g'`" 
     287 
     288   echo "install -FUy $fullopts" > /tmp/err 
     289   # Lets check for any conflicts doing this install 
     290   check_pkg_conflicts "install -FUy $fullopts" 
     291   exit $? 
     292} 
     293 
    281294intercept_pkg_dl() 
    282295{ 
    283    local count=0; 
    284    fullopts="$@" 
    285    op="$1" 
    286     
    287    # Make sure we insert some flags we need 
    288    while [ $# -gt 0 ]; do 
    289      if [ $count -gt 0 ] ; then 
    290         # If we are already using -n, we can skip downloading anything 
    291         if [ "$1" = "-n" ] ; then 
    292            pkg $fullopts 
    293            exit $? 
    294         fi 
    295         flags="$flags $1" 
    296      else 
    297         flags="-U -n" 
    298      fi 
    299      count=`expr $count + 1` 
    300      shift 
    301    done 
    302  
    303    # Lets check for any conflicts doing this install 
    304    check_pkg_conflicts "${op} -FUy $flags" 
    305    if [ $? -ne 0 ] ; then 
    306         exit 1 
    307    fi 
    308  
    309296   # Time to run pkgng and let it do its thing 
    310    pkg $fullopts  
     297   pkg $@ 
    311298   result=$? 
    312299 
     
    347334{ 
    348335   case $1 in 
    349  install|upgrade) intercept_pkg_dl ${@} ;; 
     336         install) intercept_pkg_dl ${@} ;; 
     337  check-conflict) do_pkg_conflicts ${@} ;; 
    350338         getfile) get_file_dl ${@} ;; 
    351339               *) pkg ${@}  
Note: See TracChangeset for help on using the changeset viewer.