INNER CODE UNIT · Python
package_bundle
CyrilPeng/Venera-Next · debian/build.py:46
def package_bundle(bundle, output, arch, version):
deb_version, _ = versions(version)
output.mkdir(parents=True, exist_ok=True)
package = output / f"venera-next_{deb_version}_{DEBIAN_ARCHES[arch]}.deb"
with tempfile.TemporaryDirectory(prefix="venera-deb-") as temp:
stage = Path(temp) / "package"
stage_package(bundle, stage, arch, version)
temporary_package = Path(temp) / package.name
subprocess.run(
["dpkg-deb", "--root-owner-group", "--build", str(stage), str(temporary_package)],
check=True,
)
# Do not replace an existing artifact until dpkg-deb succeeds.
shutil.copyfile(temporary_package, package)
return package
def main():