Ignore:
Timestamp:
10/25/13 10:25:42 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
59bd189e, 47cbe52
Parents:
f15ae5d
Message:

Add the first backend functions for EasyPBI to pull information from the pkgng repo instead of requiring a local copy of the FreeBSD ports tree. Just missing the ability to read the pkg-plist within a package now.

File:
1 edited

Legend:

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

    r1620346 r7a4b57b  
    3434  return QIcon(iconPath); 
    3535} 
     36 
     37QStringList Backend::getCmdOutput(QString cmd){ 
     38  QProcess *proc = new QProcess; 
     39  proc->setProcessChannelMode(QProcess::MergedChannels); 
     40  proc->start(cmd); 
     41  while(!proc->waitForFinished(300)){ 
     42    QCoreApplication::processEvents(); 
     43  } 
     44  QStringList out = QString(proc->readAllStandardOutput()).split("\n");  
     45  delete proc;   
     46  return out; 
     47} 
     48 
     49// ==================== 
     50//  PACKAGE DATABASE TOOLS 
     51// ==================== 
     52QStringList Backend::getPkgList(){ 
     53  //Generate an alphabetized list of all available packages on the repo 
     54  //format: <category>/<pkgname> 
     55  QString cmd = "pkg search -o \"/\""; 
     56  QStringList result = getCmdOutput(cmd); 
     57  return result; 
     58} 
     59 
     60QStringList Backend::getPkgInfo(QString pkgname){ 
     61  //Function to query the package repository and pull down information about a particular package 
     62  //Output: <name>, <port>, <maintainer>, <website> 
     63  QString cmd = "pkg rquery \"%n\\n%o\\n%m\\n%w\" "+pkgname; 
     64  QStringList out = Backend::getCmdOutput(cmd); 
     65  return out; 
     66} 
     67 
     68QStringList Backend::getPkgOpts(QString pkgname){ 
     69  //Function to query the package repository and pull down information about a particular package 
     70  //Output: <name>, <port>, <maintainer>, <website> 
     71  QString cmd = "pkg rquery \"%Ok=%Ov\" "+pkgname; 
     72  QStringList out = Backend::getCmdOutput(cmd); 
     73  return out; 
     74} 
Note: See TracChangeset for help on using the changeset viewer.