diff --git a/build-scripts/generate-bom.py b/build-scripts/generate-bom.py index 49e607f82..8b30b209b 100755 --- a/build-scripts/generate-bom.py +++ b/build-scripts/generate-bom.py @@ -12,8 +12,12 @@ SNAPCRAFT_PART_BUILD = Path(os.getenv("SNAPCRAFT_PART_BUILD", "")) SNAPCRAFT_PART_INSTALL = Path(os.getenv("SNAPCRAFT_PART_INSTALL", "")) -BUILD_DIRECTORY = SNAPCRAFT_PART_BUILD.exists() and SNAPCRAFT_PART_BUILD or DIR / ".build" -INSTALL_DIRECTORY = SNAPCRAFT_PART_INSTALL.exists() and SNAPCRAFT_PART_INSTALL or DIR / ".install" +BUILD_DIRECTORY = ( + SNAPCRAFT_PART_BUILD.exists() and SNAPCRAFT_PART_BUILD or DIR / ".build" +) +INSTALL_DIRECTORY = ( + SNAPCRAFT_PART_INSTALL.exists() and SNAPCRAFT_PART_INSTALL or DIR / ".install" +) # List of tools used to build or bundled in the snap TOOLS = { @@ -51,11 +55,15 @@ def _read_file(path: Path) -> str: component_dir = DIR / "components" / component try: - version = _read_file([component_dir / "version"]) - patches = _parse_output([sys.executable, DIR / "print-patches-for.py", component, version]) + version = _read_file(component_dir / "version") + patches = _parse_output( + [sys.executable, DIR / "print-patches-for.py", component, version] + ) clean_patches = [] if patches: - clean_patches = [p[p.find("build-scripts/") :] for p in patches.split("\n")] + clean_patches = [ + p[p.find("build-scripts/") :] for p in patches.split("\n") + ] BOM["components"][component] = { "repository": _read_file(component_dir / "repository"),