mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
If there are no .conf files for the pkg repos yet, have it run "pkg update" to generate them and re-try the repo list function.
This commit is contained in:
@@ -327,10 +327,14 @@ QJsonArray PKG::list_categories(QString repo){
|
||||
else{ return QJsonArray(); }
|
||||
}
|
||||
|
||||
QJsonArray PKG::list_repos(){
|
||||
QJsonArray PKG::list_repos(bool updated){
|
||||
QString dbdir = "/var/db/pkg/repo-%1.sqlite";
|
||||
QDir confdir("/usr/local/etc/pkg/repos");
|
||||
QStringList confs = confdir.entryList(QStringList() << "*.conf", QDir::Files);
|
||||
if(confs.isEmpty() && !updated){
|
||||
QProcess::execute("pkg update"); //need to update pkg configs
|
||||
return list_repos(true); //try again recursively (will not try to update again)
|
||||
}
|
||||
QStringList found;
|
||||
found << "local"; //There is always a local database (for installed pkgs)
|
||||
for(int i=0; i<confs.length(); i++){
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
static QJsonObject pkg_info(QStringList origins, QString repo, QString category = "", bool fullresults = true);
|
||||
static QStringList pkg_search(QString repo, QString searchterm, QStringList searchexcludes, QString category = "");
|
||||
static QJsonArray list_categories(QString repo);
|
||||
static QJsonArray list_repos();
|
||||
static QJsonArray list_repos(bool updated = false);
|
||||
|
||||
//pkg modification routines (dispatcher events for notifications)
|
||||
static QJsonObject pkg_install(QStringList origins, QString repo);
|
||||
|
||||
Reference in New Issue
Block a user