Changeset b1f38ed


Ignore:
Timestamp:
07/14/14 09:39:13 (13 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
4adbef9
Parents:
c7c25aa
Message:

Add the ability to install PBI's into a new jail via the new "pbi_add -J <app>" option in the PBI system. This is not attached to the main UI yet - still need to find a good way to integrate it.

Location:
src-qt4/pc-softwaremanager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    rf3fda6b rb1f38ed  
    266266  //Now emit the signal that items have changed or been added 
    267267  emit LocalPBIChanges(); 
     268} 
     269 
     270void PBIBackend::installAppIntoJail(QString appID){ 
     271  NGApp app; 
     272    if(APPHASH.contains(appID)){ app = APPHASH[appID]; } 
     273    else if(PKGHASH.contains(appID)){ app = PKGHASH[appID]; } 
     274    else{ qDebug() << "Invalid application ID:" << appID; return; } 
     275  if(app.pbiorigin.isEmpty()){ 
     276    qDebug() << "Installing into a new jail only works with PBI's!!"; 
     277    return; 
     278  } 
     279  PENDING << appID+"::::"+"pbi_add -J "+appID+"::::--newjail"; 
     280  //Now check/start the process 
     281  QTimer::singleShot(0,this,SLOT(checkProcesses()) ); 
    268282} 
    269283 
     
    801815   bool injail = !PKGJAIL.isEmpty(); 
    802816   QHash<QString, NGApp> hash; 
    803    if(JAILPKGS.contains(PKGJAIL)){ hash = JAILPKGS[PKGJAIL]; } 
     817   if(JAILPKGS.contains(PKGJAIL) && PKGJAIL!="--newjail"){ hash = JAILPKGS[PKGJAIL]; } 
    804818   else if(APPHASH.contains(PKGRUN)){ hash = APPHASH; } 
    805819   else if(PKGHASH.contains(PKGRUN)){ hash = PKGHASH; } 
     
    807821   bool skip = false; //need to skip this PENDING entry for some reason 
    808822   if( hash.isEmpty() ){ skip = true; qDebug() << PKGRUN+":" << "pkg not on repo";} //invalid pkg on the repo 
    809    else if( PROCTYPE==0 && hash.value(PKGRUN).isInstalled ){ skip = true; qDebug() << PKGRUN+":"  << "already installed"; } //already installed 
     823   else if( PROCTYPE==0 && hash.value(PKGRUN).isInstalled && PKGJAIL!="--newjail"){ skip = true; qDebug() << PKGRUN+":"  << "already installed"; } //already installed 
    810824   else if( PROCTYPE==1 && !hash.value(PKGRUN).isInstalled ){ skip = true; qDebug() << PKGRUN+":"  << "already uninstalled"; } //not installed 
    811825   if(skip){ 
     
    820834   if(PROCTYPE==1 && !injail && PKGCMD.startsWith("pc-pkg ") ){ 
    821835     Extras::getCmdOutput("pbi_icon del-desktop del-menu del-mime "+PKGRUN); //don't care about result 
    822    }else if( PROCTYPE==0 && injail && RUNNINGJAILS.contains(PKGJAIL)){ 
     836   }else if( PROCTYPE==0 && injail && RUNNINGJAILS.contains(PKGJAIL) && PKGJAIL!="--newjail"){ 
    823837     //For installations, make sure the jail pkg config is synced with the current system pkg config 
    824838     qDebug() << "Syncing pkg config in jail:" << PKGJAIL; 
     
    899913    //update the local system info 
    900914    slotSyncToDatabase(true); 
     915  }else if(PKGJAIL=="--newjail"){ 
     916    //Check for the new jail 
     917    checkForJails(); 
    901918  }else{ 
    902     //Just update the pkg list for the jail 
     919    //Just update the pkg list for this particular jail 
    903920    checkForJails(PKGJAIL); 
    904921  } 
     
    935952      //populate the list of base dependencies that cannot be removed 
    936953      BASELIST = listDependencies("misc/pcbsd-base"); 
     954      BASELIST.prepend("misc/pcbsd-base"); 
    937955      BASELIST.removeDuplicates(); 
    938956      firstrun = true; 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    r04cd6c8 rb1f38ed  
    6767        void removePBI(QStringList appID, QString injail=""); //start the removal process 
    6868        void installApp(QStringList appID, QString injail=""); //install application from the repo 
     69        void installAppIntoJail(QString appID);                 //install application into a new jail 
    6970        void lockApp(QStringList appID, QString injail="");    //Lock current version of application 
    7071        void unlockApp(QStringList appID, QString injail=""); //unlock an application 
Note: See TracChangeset for help on using the changeset viewer.