Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform lower case comparison of add-on names when updating, and make sure not to remove the previous add-on when the current add-on fails installation #9334

Merged
merged 2 commits into from May 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/gui/addonGui.py
Expand Up @@ -465,7 +465,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():
feerrenrut marked this conversation as resolved.
Show resolved Hide resolved
prevAddon=addon
break
if prevAddon:
Expand Down Expand Up @@ -496,7 +496,6 @@ def installAddon(parentWindow, addonPath):
wx.YES|wx.NO|wx.ICON_WARNING
) != wx.YES:
return False
prevAddon.requestRemove()

from contextlib import contextmanager

Expand Down Expand Up @@ -525,6 +524,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)
Expand Down