assemblers/ostree.commit: version metadata support
Add a new `os_version` option that will result in the `version` metadata being set as commit metadata. This will then be shown in the `rpm-ostree status` output.
This commit is contained in:
parent
e1e50c3339
commit
b89ef5aa5e
1 changed files with 11 additions and 0 deletions
|
|
@ -37,6 +37,10 @@ SCHEMA = """
|
|||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"os_version": {
|
||||
"description": "Set the version of the OS as commit metadata",
|
||||
"type": "string"
|
||||
},
|
||||
"tmp-is-dir": {
|
||||
"description": "Create a regular directory for /tmp",
|
||||
"type": "boolean",
|
||||
|
|
@ -104,6 +108,7 @@ def init_rootfs(root, tmp_is_dir):
|
|||
|
||||
def main(tree, output_dir, options, meta):
|
||||
ref = options["ref"]
|
||||
os_version = options.get("os_version", None)
|
||||
tmp_is_dir = options.get("tmp-is-dir", True)
|
||||
parent = options.get("parent", None)
|
||||
tar = options.get("tar", None)
|
||||
|
|
@ -142,8 +147,14 @@ def main(tree, output_dir, options, meta):
|
|||
argv += [
|
||||
f"--add-metadata-string=rpmostree.inputhash={meta['id']}",
|
||||
f"--write-composejson-to={output_dir}/compose.json"
|
||||
|
||||
]
|
||||
|
||||
if os_version:
|
||||
argv += [
|
||||
f"--add-metadata-string=version={os_version}",
|
||||
]
|
||||
|
||||
with treefile.as_tmp_file() as path:
|
||||
argv += [path, root]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue