diff --git a/common/flatpak-image-source-private.h b/common/flatpak-image-source-private.h index 42f1a5bb..5f9604d8 100644 --- a/common/flatpak-image-source-private.h +++ b/common/flatpak-image-source-private.h @@ -75,4 +75,5 @@ void flatpak_image_source_build_commit_metadata (FlatpakImageSource *self, GVariantBuilder *metadata_builder); GVariant *flatpak_image_source_make_fake_commit (FlatpakImageSource *image_source); +GVariant *flatpak_image_source_make_summary_metadata (FlatpakImageSource *self); #endif /* __FLATPAK_IMAGE_SOURCE_H__ */ diff --git a/common/flatpak-image-source.c b/common/flatpak-image-source.c index ef29a976..66a19c81 100644 --- a/common/flatpak-image-source.c +++ b/common/flatpak-image-source.c @@ -500,3 +500,20 @@ flatpak_image_source_make_fake_commit (FlatpakImageSource *self) ostree_checksum_to_bytes_v ("0000000000000000000000000000000000000000000000000000000000000000"), ostree_checksum_to_bytes_v ("0000000000000000000000000000000000000000000000000000000000000000"))); } + +GVariant * +flatpak_image_source_make_summary_metadata (FlatpakImageSource *self) +{ + g_autoptr(GVariantBuilder) ref_metadata_builder = NULL; + + ref_metadata_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}")); + + if (self->repository) + g_variant_builder_add (ref_metadata_builder, "{sv}", "xa.oci-repository", + g_variant_new_string (self->repository)); + if (self->delta_url) + g_variant_builder_add (ref_metadata_builder, "{sv}", "xa.delta-url", + g_variant_new_string (self->delta_url)); + + return g_variant_ref_sink (g_variant_builder_end (ref_metadata_builder)); +}