From 845c68a8089a174703a5ce74500947e0fe85e0ce Mon Sep 17 00:00:00 2001 From: titoko titoko Date: Mon, 25 Nov 2013 13:14:23 +0100 Subject: [PATCH 1/2] bugfix remove app --- yunohost_app.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/yunohost_app.py b/yunohost_app.py index 95a4f366..994986a3 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -439,12 +439,18 @@ def app_remove(app): raise YunoHostError(22, _("App is not installed")) app_setting_path = apps_setting_path + app - os.system('chmod -R 777 '+ app_setting_path) #TODO: display fail messages from script - os.system('cp '+ app_setting_path + '/scripts/remove /tmp/yunohost_remove && chown admin: /tmp/yunohost_remove') - if hook_exec('/tmp/yunohost_remove') != 0: - os.system('chmod -hR 700 '+ app_setting_path) + try: + shutil.rmtree('/tmp/yunohost_remove') + except: pass + + os.system('cp -a '+ app_setting_path + ' /tmp/yunohost_remove && chown -hR admin: /tmp/yunohost_remove') + os.system('chown -R admin: /tmp/yunohost_remove') + os.system('chmod -R u+rX /tmp/yunohost_remove') + + if hook_exec('/tmp/yunohost_remove/scripts/remove') != 0: + pass if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path) os.remove('/tmp/yunohost_remove') From c8bc95e645b47c981cdd2dc51d41f958d76512b5 Mon Sep 17 00:00:00 2001 From: titoko titoko Date: Mon, 25 Nov 2013 18:23:53 +0100 Subject: [PATCH 2/2] reload ssowat when app_install and app_remove --- yunohost_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yunohost_app.py b/yunohost_app.py index 994986a3..a4e32318 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -418,6 +418,7 @@ def app_install(app, label=None, args=None): os.system('chmod -R 400 '+ app_setting_path) os.system('chown -R root: '+ app_setting_path) os.system('chown -R admin: '+ app_setting_path +'/scripts') + app_ssowatconf() win_msg(_("Installation complete")) else: #TODO: display script fail messages @@ -454,7 +455,7 @@ def app_remove(app): if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path) os.remove('/tmp/yunohost_remove') - + app_ssowatconf() win_msg(_("App removed: ")+ app)