From d8145677d670268426794aedb05a117a4c1da757 Mon Sep 17 00:00:00 2001 From: Wojciech Zygmunt Porczyk Date: Thu, 30 Jan 2014 17:47:18 +0100 Subject: [PATCH] appicons: fix directory creation and removal (when missing) --- appmenus-scripts/qubes-core-appmenus.py | 1 + appmenus-scripts/qubes-receive-appmenus | 3 +++ 2 files changed, 4 insertions(+) diff --git a/appmenus-scripts/qubes-core-appmenus.py b/appmenus-scripts/qubes-core-appmenus.py index 9b34aa0..4ee2d00 100644 --- a/appmenus-scripts/qubes-core-appmenus.py +++ b/appmenus-scripts/qubes-core-appmenus.py @@ -121,6 +121,7 @@ def QubesVm_appicons_create(self, srcdir=None): self.label.color) def QubesVm_appicons_remove(self): + if not os.path.exists(self.appmenus_icons_dir): return for icon in os.listdir(self.appmenus_icons_dir): os.unlink(os.path.join(self.appmenus_icons_dir, icon)) diff --git a/appmenus-scripts/qubes-receive-appmenus b/appmenus-scripts/qubes-receive-appmenus index 111f109..5c8a591 100755 --- a/appmenus-scripts/qubes-receive-appmenus +++ b/appmenus-scripts/qubes-receive-appmenus @@ -216,6 +216,9 @@ def main(): if not os.path.exists(vm.appmenus_templates_dir): os.mkdir(vm.appmenus_templates_dir) + if not os.path.exists(vm.appmenus_template_icons_dir): + os.mkdir(vm.appmenus_template_icons_dir) + # Create new/update existing templates if options.verbose: print >> sys.stderr, "--> Got {0} appmenus, storing to disk".format(str(len(new_appmenus)))