ostree/container: Set version in treefile 'automatic-version-prefix'
In the non container path, we're setting the version for the build using
the `--add-metadata-string=version=XYZ` argument passed to `rpm-ostree
compose tree ...`.
The `rpm-ostree compose image` path does not expose this option yet so
modify the treefile directly as we are already doing it to set the
repos used for the compose.
See: https://github.com/coreos/rpm-ostree/issues/4829
See: https://pagure.io/workstation-ostree-config/pull-request/472
Merges: https://pagure.io/pungi/pull-request/1726
Signed-off-by: Timothée Ravier <tim@siosm.fr>
(cherry picked from commit 8412890640
)
This commit is contained in:
parent
75ab6a14b2
commit
05d9651eba
@ -74,7 +74,7 @@ class Container(OSTree):
|
||||
repos = []
|
||||
keep_original_sources = True
|
||||
|
||||
update_dict = {}
|
||||
update_dict = {"automatic-version-prefix": self.args.version}
|
||||
|
||||
self.treefile = tweak_treeconf(
|
||||
self.treefile,
|
||||
|
@ -121,10 +121,11 @@ class OSTreeContainerThread(WorkerThread):
|
||||
):
|
||||
target_dir = compose.paths.compose.image_dir(variant) % {"arch": arch}
|
||||
util.makedirs(target_dir)
|
||||
version = util.version_generator(compose, config.get("version"))
|
||||
archive_name = "%s-%s-%s" % (
|
||||
compose.conf["release_short"],
|
||||
variant.uid,
|
||||
util.version_generator(compose, config.get("version")),
|
||||
version,
|
||||
)
|
||||
|
||||
# Run the pungi-make-ostree command locally to create a script to
|
||||
@ -137,6 +138,7 @@ class OSTreeContainerThread(WorkerThread):
|
||||
"--path=%s" % target_dir,
|
||||
"--treefile=%s" % os.path.join(config_repo, config["treefile"]),
|
||||
"--extra-config=%s" % extra_config_file,
|
||||
"--version=%s" % version,
|
||||
]
|
||||
|
||||
_, runroot_script = shortcuts.run(cmd, universal_newlines=True)
|
||||
|
Loading…
Reference in New Issue
Block a user