stages/rpm: allow check_gpg to be omitted

This brings it in line with the JSON schema. Also fix a bug where the
wrong root was used for checking the signatures.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-06-10 13:37:04 +02:00 committed by Lars Karlitski
parent b0bf9c9392
commit 72e1e7217b

View file

@ -101,12 +101,13 @@ def main(tree, sources, options):
osbuild.sources.get("org.osbuild.files", checksums) osbuild.sources.get("org.osbuild.files", checksums)
for pkg in packages: for pkg in packages:
if pkg["check_gpg"]: if pkg.get("check_gpg"):
subprocess.run( subprocess.run([
["rpmkeys", "--checksig", pkg["checksum"]], "rpmkeys",
cwd=f"{sources}/org.osbuild.files", "--root", tree,
stdout=subprocess.DEVNULL, "--checksig",
check=True) pkg["checksum"]
], cwd=f"{sources}/org.osbuild.files", stdout=subprocess.DEVNULL, check=True)
script = f""" script = f"""
set -e set -e