More flexible moulinette

This commit is contained in:
npze 2013-07-22 17:46:56 +02:00
parent ac59954aee
commit fbe98ca0e1

View file

@ -327,11 +327,12 @@ def app_upgrade(app, instance=[], url=None, file=None):
######################################### #########################################
# TMP: Remove old application # TMP: Remove old application
if os.path.exists(app_final_path): shutil.rmtree(app_final_path) # if os.path.exists(app_final_path): shutil.rmtree(app_final_path)
os.system('cp -a "'+ app_tmp_folder +'" "'+ app_final_path +'"') os.system('cp -a "'+ app_tmp_folder +'" "'+ app_final_path +'"')
if is_web: if is_web:
if app_type != 'privileged' and app_type != 'certified':
os.system('chown -R www-data: "'+ app_final_path +'"') os.system('chown -R www-data: "'+ app_final_path +'"')
os.system('service apache2 reload') os.system('service apache2 reload')
shutil.rmtree(app_final_path + manifest['yunohost']['script_path']) shutil.rmtree(app_final_path + manifest['yunohost']['script_path'])
@ -512,6 +513,9 @@ def app_install(app, domain, path='/', label=None, mode='private'):
# Apache # # Apache #
########## ##########
if lvl(manifest,'yunohost','webapp','custom_apache_conf'):
os.system('mv '+app_tmp_folder+'/'+manifest['yunohost']['webapp']['custom_apache_conf']+' '+a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf')
else:
a2_conf_lines = [ 'Alias '+ path +' '+ app_final_path + manifest['launch_path'] ] a2_conf_lines = [ 'Alias '+ path +' '+ app_final_path + manifest['launch_path'] ]
if path != '/': if path != '/':
a2_conf_lines.append('Alias '+ path[:len(path)-1] +' '+ app_final_path + manifest['launch_path']) a2_conf_lines.append('Alias '+ path[:len(path)-1] +' '+ app_final_path + manifest['launch_path'])
@ -536,11 +540,12 @@ def app_install(app, domain, path='/', label=None, mode='private'):
except OSError: os.makedirs(apps_path) except OSError: os.makedirs(apps_path)
# TMP: Remove old application # TMP: Remove old application
if os.path.exists(app_final_path): shutil.rmtree(app_final_path) # if os.path.exists(app_final_path): shutil.rmtree(app_final_path)
os.system('cp -a "'+ app_tmp_folder +'" "'+ app_final_path +'"') os.system('cp -a "'+ app_tmp_folder +'" "'+ app_final_path +'"')
if is_web: if is_web:
if app_type != 'privileged' and app_type != 'certified':
os.system('chown -R www-data: "'+ app_final_path +'"') os.system('chown -R www-data: "'+ app_final_path +'"')
os.system('service apache2 reload') os.system('service apache2 reload')
shutil.rmtree(app_final_path + manifest['yunohost']['script_path']) shutil.rmtree(app_final_path + manifest['yunohost']['script_path'])