raise src.SatException( e );
merger.merge(cfg, local_cfg)
- # When the key is "unknown", put the default value
- if cfg.LOCAL.base == "unknown":
+ # When the key is "default", put the default value
+ if cfg.LOCAL.base == "default":
cfg.LOCAL.base = os.path.abspath(
os.path.join(cfg.VARS.salometoolsway,
"..",
"BASE"))
- if cfg.LOCAL.workdir == "unknown":
+ if cfg.LOCAL.workdir == "default":
cfg.LOCAL.workdir = os.path.abspath(
os.path.join(cfg.VARS.salometoolsway,
".."))
- if cfg.LOCAL.log_dir == "unknown":
+ if cfg.LOCAL.log_dir == "default":
cfg.LOCAL.log_dir = os.path.abspath(
os.path.join(cfg.VARS.salometoolsway,
"..",
"LOGS"))
+ if cfg.LOCAL.archive_dir == "default":
+ cfg.LOCAL.archive_dir = os.path.abspath(
+ os.path.join(cfg.VARS.salometoolsway,
+ "..",
+ "ARCHIVES"))
+
# apply overwrite from command line if needed
for rule in self.get_command_line_overrides(options, ["LOCAL"]):
exec('cfg.' + rule) # this cannot be factorized because of the exec
cfg.PATHS.JOBPATH.append(cfg.VARS.personal_jobs_dir, "")
cfg.PATHS["MACHINEPATH"] = src.pyconf.Sequence(cfg.PATHS)
cfg.PATHS.MACHINEPATH.append(cfg.VARS.personal_machines_dir, "")
+
+ # initialise the path with local directory
+ cfg.PATHS["ARCHIVEPATH"].append(cfg.LOCAL.archive_dir, "")
+
# Loop over the projects in order to complete the PATHS variables
for project in cfg.PROJECTS.projects:
for PATH in ["APPLICATIONPATH",
'evince',
"This is the pdf_viewer used "
"to read pdf documentation\n")
- user_cfg.USER.addMapping("base",
- src.pyconf.Reference(
- user_cfg,
- src.pyconf.DOLLAR,
- 'workdir + $VARS.sep + "BASE"'),
- "The products installation base (could be "
- "ignored if this key exists in the local.pyconf"
- " file of salomTools).\n")
+# CNC 25/10/17 : plus nécessaire a priori
+# user_cfg.USER.addMapping("base",
+# src.pyconf.Reference(
+# user_cfg,
+# src.pyconf.DOLLAR,
+# 'workdir + $VARS.sep + "BASE"'),
+# "The products installation base (could be "
+# "ignored if this key exists in the local.pyconf"
+# " file of salomTools).\n")
#
src.ensure_path_exists(config.VARS.personalDir)
parser.add_option('w', 'workdir', 'string', 'workdir',
_('Optional: The path to the working directory '
'(where to install the applications'))
+parser.add_option('a', 'archive_dir', 'string', 'archive_dir',
+ _('Optional: The path to the local archive directory '
+ '(where to install local source archives'))
parser.add_option('v', 'VCS', 'string', 'VCS',
_('Optional: The address of the repository of SAT '
'(only informative)'))
info = [("base", config.LOCAL.base),
("workdir", config.LOCAL.workdir),
("log_dir", config.LOCAL.log_dir),
+ ("archive_dir", config.LOCAL.archive_dir),
("VCS", config.LOCAL.VCS),
("tag", config.LOCAL.tag)]
src.print_info(logger, info)
:param path_to_check Str: The path to check.
:param logger Logger: The logger instance.
"""
- if path_to_check == "unknown":
+ if path_to_check == "default":
return 0
# Get the path
# Set the options corresponding to a directory
for opt in [("base" , options.base),
("workdir", options.workdir),
- ("log_dir", options.log_dir)]:
+ ("log_dir", options.log_dir),
+ ("archive_dir", options.archive_dir)]:
key, value = opt
if value:
res_check = check_path(value, logger)
display_local_values(runner.cfg, logger)
- return res
\ No newline at end of file
+ return res