Reverse the pkg repo enabled logic.

default to enabled, look for no/false section to disable.
Seems to fix the issue with a repo config file not including the enabled section at all, but pkg still using it.
This commit is contained in:
Ken Moore
2019-05-23 19:51:51 -04:00
parent b7fa03d2b8
commit d018263559

View File

@@ -390,7 +390,8 @@ QJsonArray PKG::list_repos(bool updated){
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"));
bool isEnabled = true;
if(enabled.contains("no") || enabled.contains("false")){ isEnabled = false; }
qDebug() << "Checking Repo:" << repo << enabled << isEnabled;
if(QFile::exists(dbdir.arg(repo)) && isEnabled){ found << repo; }
} //loop over repos listed in conf