build,json: store arch_packages in profiles.json
authorPaul Spooren <mail@aparcar.org>
Wed, 1 Jul 2020 02:00:25 +0000 (16:00 -1000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 13 Jul 2020 20:24:30 +0000 (21:24 +0100)
The `arch_packages` contains the supported package architecture.

Previously it was necessary to parse the `Packages` index for the line
`Architecture:`, requiring both an additional parser and file download.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit f09b9319c666e343763c7618878a503ad7eb7531)

scripts/json_overview_image_info.py

index 59d69df314e9e2820cbf4b28aea1959a93577fa3..20b14f236b3918e825d31b9f6b75e98b1bf379b5 100755 (executable)
@@ -33,19 +33,22 @@ for json_file in work_dir.glob("*.json"):
             )
 
 
-output["default_packages"] = run(
+default_packages, output["arch_packages"] = run(
     [
         "make",
         "--no-print-directory",
         "-C",
         f"target/linux/{output['target'].split('/')[0]}",
         "val.DEFAULT_PACKAGES",
+        "val.ARCH_PACKAGES",
     ],
     capture_output=True,
     check=True,
     env=environ.copy().update({"TOPDIR": Path().cwd()}),
     text=True,
-).stdout.split()
+).stdout.splitlines()
+
+output["default_packages"] = default_packages.split()
 
 if output:
     output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))