]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
build: reject non-matching artifacts 22385/head
authorEric Fahlgren <ericfahlgren@gmail.com>
Wed, 11 Mar 2026 20:16:34 +0000 (13:16 -0700)
committerRobert Marko <robimarko@gmail.com>
Thu, 12 Mar 2026 08:31:25 +0000 (09:31 +0100)
Check for malformed artifact names before dereferencing them.

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

index c8d0e0ad4526415c81305768abc9f4527d82b0cd..0449bb56d7ee52181a56f6a28b26b2e209aee511 100755 (executable)
@@ -36,8 +36,9 @@ def add_artifact(artifact, prefix="openwrt-"):
         output[artifact] = {}
         for file in files:
             file = str(file.name)
-            arch = re.match(r".*Linux-([^.]*)\.", file).group(1)
-            output[artifact][arch] = file
+            arch = re.match(r".*Linux-([^.]*)\.", file)
+            if arch:
+                output[artifact][arch.group(1)] = file
 
 
 for json_file in work_dir.glob("*.json"):