Update ab.

This commit is contained in:
David Given
2025-07-24 23:25:41 +02:00
parent 5293e1c18b
commit 8e5d52f2c7
2 changed files with 11 additions and 13 deletions

View File

@@ -26,7 +26,7 @@ def main():
print("link", sf)
os.makedirs(dirname(sf), exist_ok=True)
try:
os.link(abspath(f), sf)
os.symlink(abspath(f), sf)
except PermissionError:
shutil.copy(f, sf)
@@ -38,6 +38,11 @@ def main():
df = dirname(f)
if df:
os.makedirs(df, exist_ok=True)
try:
os.remove(f)
except FileNotFoundError:
pass
os.rename(sf, f)

View File

@@ -501,15 +501,11 @@ def emit_rule(self, ins, outs, cmds=[], label=None):
emit(f"OUTS_{outsn}", "=", *fouts, into=lines)
emit(f"INS_{insn}", "=", *fins, into=lines)
emit(
name,
":",
hashfile,
f"$(OUTS_{outsn})",
into=lines,
)
emit(f"$(OUTS_{outsn})", ":", hashfile, into=lines)
emit(hashfile, ":", f"$(INS_{insn})", into=lines)
emit(name, ":", f"$(OUTS_{outsn})")
emit(hashfile, ":")
emit(f"\t@mkdir -p {self.dir}")
emit(f"\t@touch {hashfile}")
emit(f"$(OUTS_{outsn})", "&:",f"$(INS_{insn})", hashfile, into=lines)
if label:
emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO)" + label, into=lines)
@@ -537,9 +533,6 @@ def emit_rule(self, ins, outs, cmds=[], label=None):
emit(name, ":", *fins, into=lines)
outputFp.write("".join(lines))
if outs:
emit(f"\t$(hide) touch {hashfile}")
emit("")