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:
parent
a919299993
commit
5816d883ff
1 changed files with 7 additions and 2 deletions
|
|
@ -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"):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue