# HG changeset patch # User Mads Kiilerich # Date 1496105985 -7200 # Node ID a4715df4029954d99507255c7eb602dd260ae374 # Parent 6304efbe37a360ed6220fd4cdb96cf8ce4b56306 make-config: use %(here)s in the generated file instead of hardcoding absolute path Restore what paster make-config did until we introduced gearbox in d2aa8b1625a4. The make-config sub command was re-introduced in 6c8af2d22deb but created files with absolute paths. diff -r 6304efbe37a3 -r a4715df40299 kallithea/lib/paster_commands/make_config.py --- a/kallithea/lib/paster_commands/make_config.py Tue May 30 02:59:45 2017 +0200 +++ b/kallithea/lib/paster_commands/make_config.py Tue May 30 02:59:45 2017 +0200 @@ -125,7 +125,6 @@ # use default that cannot be replaced tmpl_stored_args.update({ 'uuid': lambda: uuid.uuid4().hex, - 'here': os.path.dirname(os.path.abspath(args.config_file)), }) try: # built in template diff -r 6304efbe37a3 -r a4715df40299 kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako Tue May 30 02:59:45 2017 +0200 +++ b/kallithea/lib/paster_commands/template.ini.mako Tue May 30 02:59:45 2017 +0200 @@ -2,6 +2,8 @@ <%text>################################################################################ <%text>################################################################################ # Kallithea - config file generated with kallithea-config # +# # +# The %(here)s variable will be replaced with the parent directory of this file# <%text>################################################################################ <%text>################################################################################ @@ -182,15 +184,15 @@ <%text>## Available Languages: <%text>## cs de fr hu ja nl_BE pl pt_BR ru sk zh_CN zh_TW lang = -cache_dir = ${here}/data -index_dir = ${here}/data/index +cache_dir = %(here)s/data +index_dir = %(here)s/data/index <%text>## perform a full repository scan on each server start, this should be <%text>## set to false after first startup, to allow faster server restarts. initial_repo_scan = false <%text>## uncomment and set this path to use archive download cache -archive_cache_dir = ${here}/tarballcache +archive_cache_dir = %(here)s/tarballcache <%text>## change this to unique ID for security app_instance_uuid = ${uuid()} @@ -337,8 +339,8 @@ <%text>### BEAKER CACHE #### <%text>#################################### -beaker.cache.data_dir = ${here}/data/cache/data -beaker.cache.lock_dir = ${here}/data/cache/lock +beaker.cache.data_dir = %(here)s/data/cache/data +beaker.cache.lock_dir = %(here)s/data/cache/lock beaker.cache.regions = short_term,long_term,sql_cache_short @@ -494,7 +496,7 @@ %if database_engine == 'sqlite': # SQLITE [default] -sqlalchemy.url = sqlite:///${here}/kallithea.db?timeout=60 +sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 %elif database_engine == 'postgres': # POSTGRESQL diff -r 6304efbe37a3 -r a4715df40299 scripts/generate-ini.py --- a/scripts/generate-ini.py Tue May 30 02:59:45 2017 +0200 +++ b/scripts/generate-ini.py Tue May 30 02:59:45 2017 +0200 @@ -21,7 +21,6 @@ mako_variable_values = { 'host': '127.0.0.1', 'port': '5000', - 'here': '%(here)s', 'uuid()': '${app_instance_uuid}', } @@ -32,8 +31,6 @@ Kallithea - config for tests: sqlalchemy and kallithea_test.sqlite custom logging - - The %(here)s variable will be replaced with the parent directory of this file ''', { '[server:main]': { @@ -72,8 +69,6 @@ initial_repo_scan = true debug = true verbose and colorful logging - - The %(here)s variable will be replaced with the parent directory of this file ''', { '[server:main]': {