From 4df274c38e98a6edc39509512937c47d19b6bd02 Mon Sep 17 00:00:00 2001 From: Leonard de Ruijter Date: Thu, 9 May 2019 18:57:03 +0200 Subject: [PATCH] Lower case addon name comparison (PR #9334) * Perform lower case comparison of add-on names when updating * Do not request removal of a possible previous add-on before it has been replaced by a new version --- source/gui/addonGui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/gui/addonGui.py b/source/gui/addonGui.py index d4f7affbae7..8867af3e948 100644 --- a/source/gui/addonGui.py +++ b/source/gui/addonGui.py @@ -491,7 +491,7 @@ def installAddon(parentWindow, addonPath): prevAddon = None for addon in addonHandler.getAvailableAddons(): - if not addon.isPendingRemove and bundle.name==addon.manifest['name']: + if not addon.isPendingRemove and bundle.name.lower()==addon.manifest['name'].lower(): prevAddon=addon break if prevAddon: @@ -522,7 +522,6 @@ def installAddon(parentWindow, addonPath): wx.YES|wx.NO|wx.ICON_WARNING ) != wx.YES: return False - prevAddon.requestRemove() from contextlib import contextmanager @@ -551,6 +550,8 @@ def doneAndDestroy(window): # Use context manager to ensure that `done` and `Destroy` are called on the progress dialog afterwards with doneAndDestroy(progressDialog): gui.ExecAndPump(addonHandler.installAddonBundle, bundle) + if prevAddon: + prevAddon.requestRemove() return True except: log.error("Error installing addon bundle from %s" % addonPath, exc_info=True)