diff options
author | Colin Walters <walters@verbum.org> | 2016-02-23 11:00:18 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2016-02-26 08:19:01 -0500 |
commit | 277220aaa6e73002d5186ba1166c11be07481727 (patch) | |
tree | 3f6b9cf00198761acb2a47501dd9e2e5a56cdc74 /src/libostree/ostree-repo-static-delta-compilation.c | |
parent | 6c285d2e4ac76e99df848e2dea3cb0633126728a (diff) | |
download | ostree-277220aaa6e73002d5186ba1166c11be07481727.tar.gz |
deltas: Include an endianness marker
We screwed up and had delta integers use host endianness. Start
digging out by at least annotating the endianness.
https://bugzilla.gnome.org/show_bug.cgi?id=762515
Diffstat (limited to 'src/libostree/ostree-repo-static-delta-compilation.c')
-rw-r--r-- | src/libostree/ostree-repo-static-delta-compilation.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index 2071bb68..e579e910 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -1306,6 +1306,10 @@ ostree_repo_static_delta_generate (OstreeRepo *self, cancellable, error)) goto out; + /* NOTE: Add user-supplied metadata first. This is used by at least + * xdg-app as a way to provide MIME content sniffing, since the + * metadata appears first in the file. + */ g_variant_builder_init (&metadata_builder, G_VARIANT_TYPE ("a{sv}")); if (metadata != NULL) { @@ -1320,6 +1324,21 @@ ostree_repo_static_delta_generate (OstreeRepo *self, } } + { guint8 endianness_char; + switch (G_BYTE_ORDER) + { + case G_LITTLE_ENDIAN: + endianness_char = 'l'; + break; + case G_BIG_ENDIAN: + endianness_char = 'B'; + break; + default: + g_assert_not_reached (); + } + g_variant_builder_add (&metadata_builder, "{sv}", "ostree.endianness", g_variant_new_byte (endianness_char)); + } + if (opt_filename) { g_autoptr(GFile) f = g_file_new_for_path (opt_filename); |