@contextmanager
def optional_tarfile(name, guard, mode="w"):
import tarfile
- import bb.compress.zstd
-
- num_threads = int(d.getVar("BB_NUMBER_THREADS"))
+ import gzip
if guard:
name.parent.mkdir(parents=True, exist_ok=True)
- with bb.compress.zstd.open(name, mode=mode + "b", num_threads=num_threads) as f:
+ with gzip.open(name, mode=mode + "b") as f:
with tarfile.open(fileobj=f, mode=mode + "|") as tf:
yield tf
else:
add_download_packages(d, doc, recipe)
if process_sources(d) and include_sources:
- recipe_archive = deploy_dir_spdx / "recipes" / (doc.name + ".tar.zst")
+ recipe_archive = deploy_dir_spdx / "recipes" / (doc.name + ".tar.gz")
with optional_tarfile(recipe_archive, archive_sources) as archive:
spdx_get_src(d)
package_doc.add_relationship(spdx_package, "GENERATED_FROM", "%s:%s" % (recipe_ref.externalDocumentId, recipe.SPDXID))
package_doc.add_relationship(package_doc, "DESCRIBES", spdx_package)
- package_archive = deploy_dir_spdx / "packages" / (package_doc.name + ".tar.zst")
+ package_archive = deploy_dir_spdx / "packages" / (package_doc.name + ".tar.gz")
with optional_tarfile(package_archive, archive_packaged) as archive:
package_files = add_package_files(
d,
if link != target_path:
link.symlink_to(os.path.relpath(target_path, link.parent))
- spdx_tar_path = imgdeploydir / (image_name + ".spdx.tar.zst")
- make_image_link(spdx_tar_path, ".spdx.tar.zst")
+ spdx_tar_path = imgdeploydir / (image_name + ".spdx.tar.gz")
+ make_image_link(spdx_tar_path, ".spdx.tar.gz")
}
python sdk_host_combine_spdx() {
from datetime import timezone, datetime
from pathlib import Path
import tarfile
- import bb.compress.zstd
+ import gzip
creation_time = datetime.now(tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
deploy_dir_spdx = Path(d.getVar("DEPLOY_DIR_SPDX"))
index = {"documents": []}
- spdx_tar_path = rootfs_deploydir / (rootfs_name + ".spdx.tar.zst")
- with bb.compress.zstd.open(spdx_tar_path, "w", num_threads=num_threads) as f:
+ spdx_tar_path = rootfs_deploydir / (rootfs_name + ".spdx.tar.gz")
+ with gzip.open(spdx_tar_path, "w") as f:
with tarfile.open(fileobj=f, mode="w|") as tar:
def collect_spdx_document(path):
nonlocal tar