]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
build: segregate build artifacts by host architecture 22331/head
authorEric Fahlgren <ericfahlgren@gmail.com>
Sun, 8 Mar 2026 20:45:42 +0000 (13:45 -0700)
committerRobert Marko <robimarko@gmail.com>
Tue, 10 Mar 2026 09:33:19 +0000 (10:33 +0100)
Add structured data to each of the build artifacts listed in
profiles.json, in order to accomodate future inclusion of different
build host architectures.

Link: https://github.com/openwrt/openwrt/pull/22264#issuecomment-4014914414
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22331
Signed-off-by: Robert Marko <robimarko@gmail.com>
scripts/json_overview_image_info.py

index fe476e10fa77db0a361c3ed43923a5a3da42137d..c8d0e0ad4526415c81305768abc9f4527d82b0cd 100755 (executable)
@@ -5,6 +5,7 @@ from pathlib import Path
 from subprocess import run, PIPE
 from sys import argv
 import json
+import re
 
 if len(argv) != 2:
     print("JSON info files script requires output file as argument")
@@ -31,8 +32,12 @@ def get_initial_output(image_info):
 
 def add_artifact(artifact, prefix="openwrt-"):
     files = list(output_dir.glob(f"{prefix}{artifact}-*"))
-    if len(files) == 1:
-        output[artifact] = str(files[0].name)
+    if len(files):
+        output[artifact] = {}
+        for file in files:
+            file = str(file.name)
+            arch = re.match(r".*Linux-([^.]*)\.", file).group(1)
+            output[artifact][arch] = file
 
 
 for json_file in work_dir.glob("*.json"):