diff --git a/src/ibek/runtime_cmds/autosave.py b/src/ibek/runtime_cmds/autosave.py index 2e6d4639..512fcf58 100644 --- a/src/ibek/runtime_cmds/autosave.py +++ b/src/ibek/runtime_cmds/autosave.py @@ -78,13 +78,12 @@ def generate_req_files(self) -> None: with open(GLOBALS.RUNTIME_OUTPUT / subst_name, "w") as f: for entry in entries: + short_name = entry.template_file.name f.write( - self.entry_fmt.format( - file=entry.template_file, pattern=entry.pattern - ) + self.entry_fmt.format(file=short_name, pattern=entry.pattern) ) run( - f"msi -S {subst_name} > {req_name}", + f"msi -S {subst_name} > {req_name} -I{GLOBALS.AUTOSAVE}", shell=True, ) diff --git a/src/ibek/runtime_cmds/commands.py b/src/ibek/runtime_cmds/commands.py index fb2e3656..6c0d0855 100644 --- a/src/ibek/runtime_cmds/commands.py +++ b/src/ibek/runtime_cmds/commands.py @@ -173,22 +173,10 @@ def generate_autosave(subst_file: Path = typer.Argument(GLOBALS.RUNTIME_SUBSTITU that line is omitted from the new substitution file. 6. Two req files are generated from the two substitution files using MSI. - Incredibly, this approach can cope with template name clashes between support - modules. - - If there is a name clash this approach will work as long as ioc.db contains - a full path reference to the db template. The corresponding entry in the - req substitutions will also use a full path. - - Unfortunately, this is not true for name clashes in req file include statements. - Autosave search path will be /epics/autosave only. I'm not expecting this to - ever come come up in practice. If it does, the solution is to rename the - template in one of the modules. - - TODO: The overrides will not currently work if full paths are used for - templates. What is good for name clashes is bad for overrides. We should - probably encourage support.yaml to use search paths for DB templates - (unless there is a name clash) or have a re-think of this + Where the database template has a full path, this will be stripped in + substitution files created in step 5. At runtime autosave will be pointed at + the /epics/autosave folder for its search path. There is an issue with name + collisions that we will address if this ever arises. """ link_req_files() asg = AutosaveGenerator(subst_file)