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
This commit is contained in:
1 parent
6c285d2e4a
commit
277220aaa6
3 files changed
+52
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user