43
43
from opengrok_tools .sync import do_sync
44
44
from opengrok_tools .config_merge import merge_config_files
45
45
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
47
47
from opengrok_tools .utils .readconfig import read_config
48
48
from opengrok_tools .utils .exitvals import SUCCESS_EXITVAL
49
49
@@ -306,8 +306,6 @@ def project_syncer(logger, loglevel, uri, config_path, sync_period,
306
306
307
307
wait_for_tomcat (logger , uri )
308
308
309
- set_config_value (logger , 'projectsEnabled' , 'true' , uri )
310
-
311
309
periodic_sync = True
312
310
if sync_period is None or sync_period == 0 :
313
311
periodic_sync = False
@@ -357,7 +355,7 @@ def project_syncer(logger, loglevel, uri, config_path, sync_period,
357
355
sleep_event .wait ()
358
356
359
357
360
- def create_bare_config (logger , extra_indexer_options = None ):
358
+ def create_bare_config (logger , use_projects , extra_indexer_options = None ):
361
359
"""
362
360
Create bare configuration file with a few basic settings.
363
361
"""
@@ -369,13 +367,16 @@ def create_bare_config(logger, extra_indexer_options=None):
369
367
'-c' , '/usr/local/bin/ctags' ,
370
368
'--remote' , 'on' ,
371
369
'-H' ,
370
+ '-S' ,
372
371
'-W' , OPENGROK_CONFIG_FILE ,
373
372
'--noIndex' ]
374
373
375
374
if extra_indexer_options :
376
375
if type (extra_indexer_options ) is not list :
377
376
raise Exception ("extra_indexer_options has to be a list" )
378
377
indexer_options .extend (extra_indexer_options )
378
+ if use_projects :
379
+ indexer_options .append ('-P' )
379
380
indexer = Indexer (indexer_options ,
380
381
jar = OPENGROK_JAR ,
381
382
logger = logger , doprint = True )
@@ -472,7 +473,7 @@ def main():
472
473
#
473
474
if not os .path .exists (OPENGROK_CONFIG_FILE ) or \
474
475
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 ())
476
477
477
478
#
478
479
# Index check needs read-only configuration so it is placed
0 commit comments