Fix relocating files when paths for generic script wrapper are specified explicitely
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
This commit is contained in:
parent
831492aa0d
commit
ed7d5ec51a
|
@ -177,9 +177,10 @@ class GenericScriptWrapperModule(Module):
|
||||||
with open(target, "wb") as f:
|
with open(target, "wb") as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
for _, file, target in self.file_outputs:
|
for dep, file, _ in self.file_outputs:
|
||||||
file = ctx.r_env.resolve(file, final=True)
|
file = ctx.r_env.resolve(file, final=True)
|
||||||
target = ctx.r_env.resolve(target, final=True)
|
target = ctx.r_env.resolve(getattr(ctx.outputs, dep), final=True)
|
||||||
|
print(f"file is: {file}, target is: {target}")
|
||||||
if target != file:
|
if target != file:
|
||||||
Path(file).rename(target)
|
Path(file).rename(target)
|
||||||
|
|
||||||
|
|
|
@ -238,12 +238,12 @@ class Flow:
|
||||||
sfprint(verbosity, f" {Style.BRIGHT + status} " f"{dep + Style.RESET_ALL}: {source}")
|
sfprint(verbosity, f" {Style.BRIGHT + status} " f"{dep + Style.RESET_ALL}: {source}")
|
||||||
|
|
||||||
def _build_dep(self, dep):
|
def _build_dep(self, dep):
|
||||||
paths = self.dep_paths.get(dep)
|
provider = self.os_map.get(dep)
|
||||||
|
r_env = self.cfg.r_env if provider is None else self.cfg.get_r_env(provider.name)
|
||||||
|
paths = r_env.resolve(self.dep_paths.get(dep))
|
||||||
if not paths:
|
if not paths:
|
||||||
sfprint(2, f"Dependency {dep} is unresolved.")
|
sfprint(2, f"Dependency {dep} is unresolved.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
provider = self.os_map.get(dep)
|
|
||||||
run = (provider.name in self.run_stages) if provider else False
|
run = (provider.name in self.run_stages) if provider else False
|
||||||
|
|
||||||
if p_req_exists(paths) and not run:
|
if p_req_exists(paths) and not run:
|
||||||
|
|
Loading…
Reference in New Issue