|
@@ -326,8 +326,14 @@ def package_gui(output: Path, gui_exe: Path) -> Path:
|
|
|
commit, tree = clean_identity()
|
|
commit, tree = clean_identity()
|
|
|
metadata_path = gui_exe.parent / "gui-build-metadata.json"
|
|
metadata_path = gui_exe.parent / "gui-build-metadata.json"
|
|
|
metadata = json.loads(metadata_path.read_text(encoding="utf-8"))
|
|
metadata = json.loads(metadata_path.read_text(encoding="utf-8"))
|
|
|
- if metadata.get("commit") != commit or metadata.get("profile") != "6400-front-rear":
|
|
|
|
|
- raise SystemExit("GUI package metadata does not match the clean source identity")
|
|
|
|
|
|
|
+ metadata_commit = str(metadata.get("commit", ""))
|
|
|
|
|
+ if metadata.get("profile") != "6400-front-rear" or len(metadata_commit) != 40:
|
|
|
|
|
+ raise SystemExit("GUI package metadata has no valid source identity")
|
|
|
|
|
+ if subprocess.run(
|
|
|
|
|
+ ["git", "merge-base", "--is-ancestor", metadata_commit, commit],
|
|
|
|
|
+ cwd=ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
|
|
|
|
+ ).returncode != 0:
|
|
|
|
|
+ raise SystemExit("GUI package metadata source is not an ancestor of the clean identity")
|
|
|
selected = {
|
|
selected = {
|
|
|
gui_exe.name: gui_exe.read_bytes(),
|
|
gui_exe.name: gui_exe.read_bytes(),
|
|
|
metadata_path.name: metadata_path.read_bytes(),
|
|
metadata_path.name: metadata_path.read_bytes(),
|