From 1197302847e2a97abc7914c37a067241e47bd240 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Apr 21 2020 22:23:16 +0000 Subject: FlatpakBuilder: Add xa.metadata as ostree commit metadata for runtimes Newer versions of flatpak (after https://github.com/flatpak/flatpak/commit/116a8b848788c582fb2c8577f1250438b100da25) verify that the metadata matches ostree commit xa.metadata key. As we use ostree directly for creating runtimes, we need to add the key manually here. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1822753 --- diff --git a/flatpak_module_tools/flatpak_builder.py b/flatpak_module_tools/flatpak_builder.py index cca8ebc..c7c889a 100644 --- a/flatpak_module_tools/flatpak_builder.py +++ b/flatpak_module_tools/flatpak_builder.py @@ -678,6 +678,9 @@ class FlatpakBuilder(object): # Run flatpak-build-finish to add extra metadata, based on finish-args self._build_finish(builddir) + with open(os.path.join(builddir, 'metadata'), 'r') as f: + metadata = f.read() + runtime_ref = 'runtime/{id}/{arch}/{branch}'.format(**args) subprocess.check_call(['ostree', 'commit', @@ -685,6 +688,7 @@ class FlatpakBuilder(object): '--owner-gid=0', '--no-xattrs', '--canonical-permissions', '--branch', runtime_ref, + '--add-metadata-string', 'xa.metadata=' + metadata, '-s', 'build of ' + runtime_ref, '--tree=tar=' + tarred_filesystem, '--tree=dir=' + builddir])