From 4d6d0426f990b86f1d56b705cefdbca7363c6e5e Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 19:42:14 +0100 Subject: [PATCH] Run the desktop disk fixture with the release version hook present --- tests/disk-root.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/disk-root.py b/tests/disk-root.py index f5f74e0..3fa8dfa 100644 --- a/tests/disk-root.py +++ b/tests/disk-root.py @@ -36,7 +36,7 @@ def prepare(args): directory.mkdir(exist_ok=True) (root / "tmp").chmod(0o1777) launcher = "usr/libexec/vinix-version-check" if args.desktop_init else "etc/inittab" - for dest in (".vinix-image-id", "userland-check.sh", launcher): + for dest in (".vinix-image-id", "userland-check.sh"): if os.path.lexists(root / dest): raise ValueError(f"fixture would overwrite /{dest}") (root / ".vinix-image-id").write_text(identity) @@ -52,6 +52,12 @@ def prepare(args): if launch.parent.resolve() != launch.parent: raise ValueError(f"fixture launcher parent is a symlink: /{launcher}") launch.parent.mkdir(parents=True, exist_ok=True) + if os.path.lexists(launch): + if not args.desktop_init or launch.is_symlink() or not launch.is_file(): + raise ValueError(f"fixture would overwrite /{launcher}") + # The release already installs this desktop hook. Unlink the + # disposable copy first so --link-inputs preserves the original. + launch.unlink() if args.desktop_init: launch.write_text(f"#!/bin/sh\n{command}\n") launch.chmod(0o755) -- 2.56.1