From b0bf9c93922f791520ffac1f2ca565b0e68954a9 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 10 Jun 2020 12:06:18 +0200 Subject: [PATCH] assemblers/ostree.commit: set inputhash metadata Use the new `meta` information passed to the assembler and use the id as the `rpmostree.inputhash` metadata that will get set on the commit. --- assemblers/org.osbuild.ostree.commit | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assemblers/org.osbuild.ostree.commit b/assemblers/org.osbuild.ostree.commit index 1a8302c4..66065796 100755 --- a/assemblers/org.osbuild.ostree.commit +++ b/assemblers/org.osbuild.ostree.commit @@ -102,7 +102,7 @@ def init_rootfs(root, tmp_is_dir): os.symlink("tmp", "sysroot/tmp", dir_fd=fd) -def main(tree, output_dir, options): +def main(tree, output_dir, options, meta): ref = options["ref"] tmp_is_dir = options.get("tmp-is-dir", True) parent = options.get("parent", None) @@ -139,7 +139,10 @@ def main(tree, output_dir, options): if parent: argv += [f"--parent={parent}"] - argv += [f"--write-composejson-to={output_dir}/compose.json"] + argv += [ + f"--add-metadata-string=rpmostree.inputhash={meta['id']}", + f"--write-composejson-to={output_dir}/compose.json" + ] with treefile.as_tmp_file() as path: argv += [path, root] @@ -166,5 +169,5 @@ def main(tree, output_dir, options): if __name__ == '__main__': args = json.load(sys.stdin) - r = main(args["tree"], args["output_dir"], args["options"]) + r = main(args["tree"], args["output_dir"], args["options"], args["meta"]) sys.exit(r)