offline delta apply: Handle the version field

It seems the format changed and this code was not updated.
This commit is contained in:
Alexander Larsson 2015-09-10 19:42:28 +02:00 committed by Colin Walters
parent 2233d443e7
commit 1ee4007a75

View File

@ -273,6 +273,7 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self,
n = g_variant_n_children (headers);
for (i = 0; i < n; i++)
{
guint32 version;
guint64 size;
guint64 usize;
const guchar *csum;
@ -285,7 +286,14 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self,
g_autoptr(GInputStream) in = NULL;
header = g_variant_get_child_value (headers, i);
g_variant_get (header, "(@aytt@ay)", &csum_v, &size, &usize, &objects);
g_variant_get (header, "(u@aytt@ay)", &version, &csum_v, &size, &usize, &objects);
if (version > OSTREE_DELTAPART_VERSION)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Delta part has too new version %u", version);
goto out;
}
if (!_ostree_repo_static_delta_part_have_all_objects (self, objects, &have_all,
cancellable, error))