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
@@ -678,6 +678,8 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
|
||||
g_autofree char *superblock_path = NULL;
|
||||
glnx_fd_close int superblock_fd = -1;
|
||||
g_autoptr(GVariant) delta_superblock = NULL;
|
||||
g_autoptr(GVariant) delta_meta = NULL;
|
||||
g_autoptr(GVariantDict) delta_metadict = NULL;
|
||||
guint64 total_size = 0, total_usize = 0;
|
||||
guint64 total_fallback_size = 0, total_fallback_usize = 0;
|
||||
guint i;
|
||||
@@ -690,7 +692,33 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
|
||||
TRUE, &delta_superblock, error))
|
||||
goto out;
|
||||
|
||||
delta_meta = g_variant_get_child_value (delta_superblock, 0);
|
||||
delta_metadict = g_variant_dict_new (delta_meta);
|
||||
|
||||
g_print ("Delta: %s\n", delta_id);
|
||||
{ guint8 endianness_char;
|
||||
const char *endianness_description;
|
||||
|
||||
if (g_variant_dict_lookup (delta_metadict, "ostree.endianness", "y", &endianness_char))
|
||||
{
|
||||
switch (endianness_char)
|
||||
{
|
||||
case 'l':
|
||||
endianness_description = "little";
|
||||
break;
|
||||
case 'B':
|
||||
endianness_description = "big";
|
||||
break;
|
||||
default:
|
||||
endianness_description = "invalid";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
endianness_description = "unknown";
|
||||
|
||||
g_print ("Endianness: %s\n", endianness_description);
|
||||
}
|
||||
{ guint64 ts;
|
||||
g_variant_get_child (delta_superblock, 1, "t", &ts);
|
||||
g_print ("Timestamp: %" G_GUINT64_FORMAT "\n", GUINT64_FROM_BE (ts));
|
||||
|
||||
Reference in new issue
Block a user