1
0
Fork 0
forked from mirror/openwrt

build: segregate build artifacts by host architecture

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>
This commit is contained in:
Eric Fahlgren 2026-03-08 13:45:42 -07:00 committed by Robert Marko
parent a919299993
commit 5816d883ff

View file

@ -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"):