From d01826355905549bf83c07dcd09fb5e11696debc Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 23 May 2019 19:51:51 -0400 Subject: [PATCH] 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. --- src/server/library/sysadm-pkg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/library/sysadm-pkg.cpp b/src/server/library/sysadm-pkg.cpp index 7555c6b..b6dceca 100644 --- a/src/server/library/sysadm-pkg.cpp +++ b/src/server/library/sysadm-pkg.cpp @@ -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