fix: print pack and lock errors on stderr

The lock refusal, "no pack for", "no manifest for" and "no pack to
verify" went to stdout, so a run redirected to a log exited 1 with
nothing on the terminal. A test reads both scripts and refuses an ERROR
line printed to stdout.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 05:22:05 +02:00
1 parent a160a5bc6b
commit 4fa598645e
4 files changed
+42 -12

No files matched your search

+2 -2
View File
@@ -467,7 +467,7 @@ def main() -> None:
try:
held.enter_context(hold_artifact_lock(args.output_dir))
except ArtifactLockBusy as exc:
print(f"ERROR: {exc}")
print(f"ERROR: {exc}", file=sys.stderr)
sys.exit(1)
all_ok = True
@@ -655,7 +655,7 @@ def main() -> None:
if stale:
print(f"Purged {len(stale)} stale pack file(s) from {out_dir}/")
except ArtifactLockBusy as exc:
print(f"ERROR: {exc}")
print(f"ERROR: {exc}", file=sys.stderr)
sys.exit(1)
pack_cmd = [