build,json: fix build failure in case no data is found
Only collect arch_packages if actually generating any output. Fixes: commit f09b9319 ("build,json: store arch_packages in profiles.json"( Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
parent
a175bc8f36
commit
3b0f698760
@ -32,8 +32,8 @@ for json_file in work_dir.glob("*.json"):
|
|||||||
image_info["profiles"][device_id]["images"][0]
|
image_info["profiles"][device_id]["images"][0]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if output:
|
||||||
default_packages, output["arch_packages"] = run(
|
default_packages, output["arch_packages"] = run(
|
||||||
[
|
[
|
||||||
"make",
|
"make",
|
||||||
"--no-print-directory",
|
"--no-print-directory",
|
||||||
@ -46,11 +46,9 @@ default_packages, output["arch_packages"] = run(
|
|||||||
check=True,
|
check=True,
|
||||||
env=environ.copy().update({"TOPDIR": Path().cwd()}),
|
env=environ.copy().update({"TOPDIR": Path().cwd()}),
|
||||||
text=True,
|
text=True,
|
||||||
).stdout.splitlines()
|
).stdout.splitlines()
|
||||||
|
|
||||||
output["default_packages"] = default_packages.split()
|
output["default_packages"] = default_packages.split()
|
||||||
|
|
||||||
if output:
|
|
||||||
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
|
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
|
||||||
else:
|
else:
|
||||||
print("JSON info file script could not find any JSON files for target")
|
print("JSON info file script could not find any JSON files for target")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user