From 745f45b68208b1e016952316a5b0fd945550da11 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 10 Feb 2022 15:44:46 +0100 Subject: [PATCH 1/2] fix: addon directory not cleared during an update --- multi_user/addon_updater.py | 20 +++++++++++--------- multi_user/addon_updater_ops.py | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/multi_user/addon_updater.py b/multi_user/addon_updater.py index d60ea02..626d627 100644 --- a/multi_user/addon_updater.py +++ b/multi_user/addon_updater.py @@ -1015,16 +1015,18 @@ class Singleton_updater(object): for path, dirs, files in os.walk(base): # prune ie skip updater folder dirs[:] = [d for d in dirs if os.path.join(path,d) not in [self._updater_path]] + + for directory in dirs: + shutil.rmtree(os.path.join(path,directory)) + for file in files: - for ptrn in self.remove_pre_update_patterns: - if fnmatch.filter([file],ptrn): - try: - fl = os.path.join(path,file) - os.remove(fl) - if self._verbose: print("Pre-removed file "+file) - except OSError: - print("Failed to pre-remove "+file) - self.print_trace() + try: + fl = os.path.join(path,file) + os.remove(fl) + if self._verbose: print("Pre-removed file "+file) + except OSError: + print("Failed to pre-remove "+file) + self.print_trace() # Walk through the temp addon sub folder for replacements # this implements the overwrite rules, which apply after diff --git a/multi_user/addon_updater_ops.py b/multi_user/addon_updater_ops.py index efe7641..349c60e 100644 --- a/multi_user/addon_updater_ops.py +++ b/multi_user/addon_updater_ops.py @@ -267,7 +267,7 @@ class addon_updater_update_now(bpy.types.Operator): clean_install: bpy.props.BoolProperty( name="Clean install", description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install", - default=False, + default=True, options={'HIDDEN'} ) From 62f52db5b2b6e4d9e26c1fa363cfe494f8e9331a Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 10 Feb 2022 16:06:53 +0100 Subject: [PATCH 2/2] fix: auto updater with tags --- multi_user/addon_updater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/addon_updater.py b/multi_user/addon_updater.py index 626d627..f6fc6d2 100644 --- a/multi_user/addon_updater.py +++ b/multi_user/addon_updater.py @@ -1703,7 +1703,7 @@ class GitlabEngine(object): def parse_tags(self, response, updater): if response == None: return [] - return [{"name": tag["name"], "zipball_url": self.get_zip_url(tag["commit"]["id"], updater)} for tag in response] + return [{"name": tag["name"], "zipball_url": f"https://gitlab.com/slumber/multi-user/-/jobs/artifacts/{tag['name']}/download?job=build"} for tag in response] # -----------------------------------------------------------------------------