From df1a97b0e1f96dc3229ac3ec01bb6e98eb17aaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 26 Aug 2016 10:40:01 +0200 Subject: [PATCH] SWU: Only enforce unequality comparison on release channel switch --- src/octoprint/plugins/softwareupdate/__init__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index 41215d03..d5f524d4 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -758,10 +758,6 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, # we are tracking github releases and are either also tracking prerelease OR are currently installed # from something that is not the stable (master) branch => we need to change some parameters - # we force python unequality check here because that will also allow us to - # downgrade on a prerelease channel change (rc/devel => rc/maintenance) - result["release_compare"] = "python_unequal" - # we compare versions fully, not just the base so that we see a difference # between RCs + stable for the same version release result["force_base"] = False @@ -786,6 +782,16 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, # to stable branch on update result["update_branch"] = check.get("update_branch", self._settings.get(["octoprint_stable_branch", "branch"])) + + if BRANCH != result.get("prerelease_channel"): + # we force python unequality check here because that will also allow us to + # downgrade on a prerelease channel change (rc/devel => rc/maintenance) + # + # we detect channel changes by comparing the current branch with the target + # branch of the release channel - unequality means we might have to handle + # a downgrade + result["release_compare"] = "python_unequal" + else: result["displayName"] = check.get("displayName", target) result["displayVersion"] = check.get("displayVersion", check.get("current", "unknown"))