Skip to content

Commit

Permalink
remove paths from req files
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 12, 2024
1 parent 2d27aff commit a96e7e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
7 changes: 3 additions & 4 deletions src/ibek/runtime_cmds/autosave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
20 changes: 4 additions & 16 deletions src/ibek/runtime_cmds/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a96e7e8

Please sign in to comment.