customization: Don't install files in /var/www

- Use the directory for service custom static files only if it exists.
- This fixes issue with lintian complaining of installing files in /var/www.

Closes #1399

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Joseph Nuthalapati committed 2018-10-09 11:30:30 +05:30
1 parent 5e13ba0424
commit faf5f5bc6c
4 files changed
+56 -63

No files matched your search

+14 -9
View File
@@ -115,16 +115,21 @@ def setup_server():
custom_static_dir = cfg.custom_static_dir
custom_static_url = '/plinth/custom/static'
config = {
'/': {
'tools.staticdir.root': custom_static_dir,
'tools.staticdir.on': True,
'tools.staticdir.dir': '.'
if os.path.exists(custom_static_dir):
config = {
'/': {
'tools.staticdir.root': custom_static_dir,
'tools.staticdir.on': True,
'tools.staticdir.dir': '.'
}
}
}
cherrypy.tree.mount(None, custom_static_url, config)
logger.debug('Serving custom static directory %s on %s', custom_static_dir,
custom_static_url)
cherrypy.tree.mount(None, custom_static_url, config)
logger.debug('Serving custom static directory %s on %s',
custom_static_dir, custom_static_url)
else:
logger.debug(
'Not serving custom static directory %s on %s, '
'directory does not exist', custom_static_dir, custom_static_url)
js_dir = '/usr/share/javascript'
js_url = '/javascript'