From 0da7e525f23c1c68adbb29e2c7c488ac12b552e9 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:31:25 +0200 Subject: [PATCH] Use new version comparison to properly detect pack updates Removes the work-around we had previously that could see a downgrade as upgrade. --- src/packmanager/packmanager.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/packmanager/packmanager.cpp b/src/packmanager/packmanager.cpp index bcf7504e..6ea3f58a 100644 --- a/src/packmanager/packmanager.cpp +++ b/src/packmanager/packmanager.cpp @@ -164,20 +164,18 @@ void PackManager::checkForUpdateFrom(const std::string& uid, const std::string& Version current = Version(version); for (auto& section: j["versions"]) { - if (!section["download_url"].is_string()) continue; // skip "null" + if (!section["download_url"].is_string()) + continue; // skip "null" std::string v = section["package_version"].get(); - if (v.empty()) continue; // skip bad version names + if (v.empty()) + continue; // skip bad version names auto ignoreIt = _ignoredSHA256.find(uid); if (ignoreIt != _ignoredSHA256.end() && ignoreIt->second.count(section["sha256"].get())) { break; } Version check = Version(v); - if (check > current || (check.Major == current.Major && - check.Minor == current.Minor && - check.Revision == current.Revision && - check.Extra != current.Extra)) - { + if (check > current) { hasUpdate = true; onUpdateAvailable.emit(this, uid, v,