From a2c926654c4078444b439cd86ac66623284f81a0 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 1 Jun 2021 14:54:40 +0200 Subject: [PATCH] inputs/files: rename refs to files The `org.osbuild.files` input provides individual files to a stage. Change the `refs` key in the returned dict to `files` to better reflect that fact. Also adapt the documentation to indicate that the keys actually paths and not necessarily checksums. This prepares for future extension of the `files` input to pipeline origins. --- inputs/org.osbuild.files | 6 +++--- stages/org.osbuild.rpm | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inputs/org.osbuild.files b/inputs/org.osbuild.files index 0b9cec98..73d01549 100755 --- a/inputs/org.osbuild.files +++ b/inputs/org.osbuild.files @@ -5,8 +5,8 @@ Inputs for individual files Provides all the files, named via their content hash, specified via `references` in a new directory. -The returned data in `refs` is a dictionary where the keys are -the content hash of a file and the values dictionaries with +The returned data in `files` is a dictionary where the keys are +paths to the provided files and the values dictionaries with metadata for it. The input itself currently does not set any metadata itself, but will forward any metadata set via the `metadata` property. Keys in that must start with a prefix, @@ -86,7 +86,7 @@ class FilesInput(inputs.InputService): reply = { "path": target, "data": { - "refs": refs + "files": refs } } return reply diff --git a/stages/org.osbuild.rpm b/stages/org.osbuild.rpm index c664154d..ca3671fc 100755 --- a/stages/org.osbuild.rpm +++ b/stages/org.osbuild.rpm @@ -213,8 +213,8 @@ def parse_input(inputs): packages = inputs["packages"] path = packages["path"] data = packages["data"] - refs = data["refs"] - return path, refs + files = data["files"] + return path, files def main(tree, inputs, options): @@ -231,13 +231,13 @@ def main(tree, inputs, options): ], check=True) print("imported gpg key") - for checksum, data in packages.items(): + for filename, data in packages.items(): if data.get("rpm.check_gpg"): subprocess.run([ "rpmkeys", "--root", tree, "--checksig", - checksum + filename ], cwd=pkgpath, stdout=subprocess.DEVNULL, check=True) script = f"""