Fix
7f4c2b1 "build,json: fix duplicates in default_packages" which
removed duplicate default packages but also removed the package
architecture from the profiles.json.
If DUMP=1 is set, the `ARCH_PACKAGES` is no longer exported and
therefore empty. Fix this by running make twice, once with DUMP=1 and
once without.
Signed-off-by: Paul Spooren <mail@aparcar.org>
- default_packages, output["arch_packages"] = run(
+ output["default_packages"] = run(
[
"make",
"--no-print-directory",
"-C",
"target/linux/{}".format(output["target"].split("/")[0]),
"val.DEFAULT_PACKAGES",
[
"make",
"--no-print-directory",
"-C",
"target/linux/{}".format(output["target"].split("/")[0]),
"val.DEFAULT_PACKAGES",
"DUMP=1",
],
stdout=PIPE,
"DUMP=1",
],
stdout=PIPE,
check=True,
env=environ.copy().update({"TOPDIR": Path().cwd()}),
universal_newlines=True,
check=True,
env=environ.copy().update({"TOPDIR": Path().cwd()}),
universal_newlines=True,
+ ).stdout.split()
+
+ output["arch_packages"] = run(
+ [
+ "make",
+ "--no-print-directory",
+ "val.ARCH_PACKAGES",
+ ],
+ stdout=PIPE,
+ stderr=PIPE,
+ check=True,
+ env=environ.copy().update({"TOPDIR": Path().cwd()}),
+ universal_newlines=True,
+ ).stdout.strip()
- output["default_packages"] = default_packages.split()
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
else:
print("JSON info file script could not find any JSON files for target")
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
else:
print("JSON info file script could not find any JSON files for target")