[openwrt/openwrt] build,json: fix generation with empty profiles
LEDE Commits
lede-commits at lists.infradead.org
Mon Jun 21 12:43:48 PDT 2021
aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/2e157714a8d4a0e1dbd6351ca0a3fe2fce75b0eb
commit 2e157714a8d4a0e1dbd6351ca0a3fe2fce75b0eb
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sun Jun 20 20:23:45 2021 -1000
build,json: fix generation with empty profiles
If the image generation doesn't add any profiles to the output the
*profile merge* will fail. To avoid that set an empty profile as
fallback.
Signed-off-by: Paul Spooren <mail at aparcar.org>
(cherry picked from commit fd0d9909bf50f114d5e7f7cedf53e542de878a2c)
---
scripts/json_overview_image_info.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index 45c05012b1..db47fd9e42 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -42,7 +42,7 @@ for json_file in work_dir.glob("*.json"):
output["profiles"][device_id]["images"].extend(profile["images"])
# make image lists unique by name, keep last/latest
-for device_id, profile in output["profiles"].items():
+for device_id, profile in output.get("profiles", {}).items():
profile["images"] = list({e["name"]: e for e in profile["images"]}.values())
More information about the lede-commits
mailing list