Run the desktop disk fixture with the release version hook present
@@ -36,7 +36,7 @@ def prepare(args):
3636 directory.mkdir(exist_ok=True)
3737 (root / "tmp").chmod(0o1777)
3838 launcher = "usr/libexec/vinix-version-check" if args.desktop_init else "etc/inittab"
39- for dest in (".vinix-image-id", "userland-check.sh", launcher):
39+ for dest in (".vinix-image-id", "userland-check.sh"):
4040 if os.path.lexists(root / dest):
4141 raise ValueError(f"fixture would overwrite /{dest}")
4242 (root / ".vinix-image-id").write_text(identity)
@@ -52,6 +52,12 @@ def prepare(args):
5252 if launch.parent.resolve() != launch.parent:
5353 raise ValueError(f"fixture launcher parent is a symlink: /{launcher}")
5454 launch.parent.mkdir(parents=True, exist_ok=True)
55+ if os.path.lexists(launch):
56+ if not args.desktop_init or launch.is_symlink() or not launch.is_file():
57+ raise ValueError(f"fixture would overwrite /{launcher}")
58+ # The release already installs this desktop hook. Unlink the
59+ # disposable copy first so --link-inputs preserves the original.
60+ launch.unlink()
5561 if args.desktop_init:
5662 launch.write_text(f"#!/bin/sh\n{command}\n")
5763 launch.chmod(0o755)