]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
build: include build artifacts in profiles.json 22264/head
authorEric Fahlgren <ericfahlgren@gmail.com>
Wed, 4 Mar 2026 01:11:45 +0000 (17:11 -0800)
committerRobert Marko <robimarko@gmail.com>
Thu, 5 Mar 2026 09:40:20 +0000 (10:40 +0100)
In order to reduce the need for html scraping, add the imagebuilder,
sdk, build toolchain and llvm-bpf toolchain file names to profiles.json.

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

index 96921c27430a86b08048442a63b978c28a23ef95..fe476e10fa77db0a361c3ed43923a5a3da42137d 100755 (executable)
@@ -11,6 +11,7 @@ if len(argv) != 2:
     exit(1)
 
 output_path = Path(argv[1])
+output_dir = output_path.parent
 
 assert getenv("WORK_DIR"), "$WORK_DIR required"
 
@@ -28,6 +29,12 @@ def get_initial_output(image_info):
     return 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)
+
+
 for json_file in work_dir.glob("*.json"):
     image_info = json.loads(json_file.read_text())
 
@@ -78,6 +85,11 @@ if output:
         "release": linux_release,
         "vermagic": linux_vermagic,
     }
+
+    for artifact in "imagebuilder", "sdk", "toolchain":
+        filename = add_artifact(artifact)
+    add_artifact("llvm-bpf", prefix="")
+
     output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
 else:
     print("JSON info file script could not find any JSON files for target")