Get the pkg repo detection systems up and running again.

This commit is contained in:
Ken Moore
2018-10-04 04:17:35 -04:00
parent 10d00d97d9
commit 694951384d
2 changed files with 4 additions and 2 deletions

View File

@@ -379,11 +379,13 @@ QJsonArray PKG::list_repos(bool updated){
QDir confdir(repodirs[d]);
QStringList confs = confdir.entryList(QStringList() << "*.conf", QDir::Files);
for(int i=0; i<confs.length(); i++){
QStringList repoinfo = General::readTextFile(confdir.absoluteFilePath(confs[i])).join("\n").split("}");
QStringList repoinfo = General::readTextFile(confdir.absoluteFilePath(confs[i])).join("\n").split("\n}");
for(int j=0; j<repoinfo.length(); j++){
//qDebug() << "Repoinfo:" << repoinfo[j];
QString repo = repoinfo[j].section(":",0,0).simplified();
QString enabled = repoinfo[j].section("enabled:",1,-1).section(":",0,0).toLower();
bool isEnabled = (enabled.contains("yes") || enabled.contains("true"));
//qDebug() << "Checking Repo:" << repo << enabled << isEnabled;
if(QFile::exists(dbdir.arg(repo)) && isEnabled){ found << repo; }
} //loop over repos listed in conf
} //loop over confs in repodir

View File

@@ -211,7 +211,7 @@ QJsonObject Update::startUpdate(QJsonObject jsin) {
//Quick check to ensure the tool is available
QString tool = "/usr/local/bin/pc-updatemanager";
QStringList flags << "pkgupdate";
QStringList flags; flags << "pkgupdate";
if(!QFile::exists(tool)){
return retObject;
}