Skip to content

Commit 19f6e23

Browse files
Vladimir Kotalahornace
authored andcommitted
take projects into account when generating bare config
fixes #3512
1 parent 09f6ab5 commit 19f6e23

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docker/start.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from opengrok_tools.sync import do_sync
4444
from opengrok_tools.config_merge import merge_config_files
4545
from opengrok_tools.utils.opengrok import list_projects, \
46-
add_project, delete_project, get_configuration, set_config_value
46+
add_project, delete_project, get_configuration
4747
from opengrok_tools.utils.readconfig import read_config
4848
from opengrok_tools.utils.exitvals import SUCCESS_EXITVAL
4949

@@ -306,8 +306,6 @@ def project_syncer(logger, loglevel, uri, config_path, sync_period,
306306

307307
wait_for_tomcat(logger, uri)
308308

309-
set_config_value(logger, 'projectsEnabled', 'true', uri)
310-
311309
periodic_sync = True
312310
if sync_period is None or sync_period == 0:
313311
periodic_sync = False
@@ -357,7 +355,7 @@ def project_syncer(logger, loglevel, uri, config_path, sync_period,
357355
sleep_event.wait()
358356

359357

360-
def create_bare_config(logger, extra_indexer_options=None):
358+
def create_bare_config(logger, use_projects, extra_indexer_options=None):
361359
"""
362360
Create bare configuration file with a few basic settings.
363361
"""
@@ -369,13 +367,16 @@ def create_bare_config(logger, extra_indexer_options=None):
369367
'-c', '/usr/local/bin/ctags',
370368
'--remote', 'on',
371369
'-H',
370+
'-S',
372371
'-W', OPENGROK_CONFIG_FILE,
373372
'--noIndex']
374373

375374
if extra_indexer_options:
376375
if type(extra_indexer_options) is not list:
377376
raise Exception("extra_indexer_options has to be a list")
378377
indexer_options.extend(extra_indexer_options)
378+
if use_projects:
379+
indexer_options.append('-P')
379380
indexer = Indexer(indexer_options,
380381
jar=OPENGROK_JAR,
381382
logger=logger, doprint=True)
@@ -472,7 +473,7 @@ def main():
472473
#
473474
if not os.path.exists(OPENGROK_CONFIG_FILE) or \
474475
os.path.getsize(OPENGROK_CONFIG_FILE) == 0:
475-
create_bare_config(logger, extra_indexer_options.split())
476+
create_bare_config(logger, use_projects, extra_indexer_options.split())
476477

477478
#
478479
# Index check needs read-only configuration so it is placed

0 commit comments

Comments
 (0)