"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "common/flatpak-utils.c" between
flatpak-1.9.1.tar.xz and flatpak-1.9.2.tar.xz

About: Flatpak is a Linux application sandboxing and distribution framework. Pre-release.

flatpak-utils.c  (flatpak-1.9.1.tar.xz):flatpak-utils.c  (flatpak-1.9.2.tar.xz)
skipping to change at line 3147 skipping to change at line 3147
} }
typedef struct typedef struct
{ {
guint64 installed_size; guint64 installed_size;
guint64 download_size; guint64 download_size;
char *metadata_contents; char *metadata_contents;
GPtrArray *subsets; GPtrArray *subsets;
GVariant *sparse_data; GVariant *sparse_data;
gsize commit_size; gsize commit_size;
guint64 commit_timestamp;
} CommitData; } CommitData;
static void static void
commit_data_free (gpointer data) commit_data_free (gpointer data)
{ {
CommitData *rev_data = data; CommitData *rev_data = data;
if (rev_data->subsets) if (rev_data->subsets)
g_ptr_array_unref (rev_data->subsets); g_ptr_array_unref (rev_data->subsets);
g_free (rev_data->metadata_contents); g_free (rev_data->metadata_contents);
skipping to change at line 3273 skipping to change at line 3274
{ {
g_auto(GVariantBuilder) sparse_builder = FLATPAK_VARIANT_BUILDER_I NITIALIZER; g_auto(GVariantBuilder) sparse_builder = FLATPAK_VARIANT_BUILDER_I NITIALIZER;
g_variant_builder_init (&sparse_builder, G_VARIANT_TYPE_VARDICT); g_variant_builder_init (&sparse_builder, G_VARIANT_TYPE_VARDICT);
gboolean has_sparse = FALSE; gboolean has_sparse = FALSE;
rev_data = g_new0 (CommitData, 1); rev_data = g_new0 (CommitData, 1);
rev_data->installed_size = var_cache_data_get_installed_size (xa_d ata); rev_data->installed_size = var_cache_data_get_installed_size (xa_d ata);
rev_data->download_size = var_cache_data_get_download_size (xa_dat a); rev_data->download_size = var_cache_data_get_download_size (xa_dat a);
rev_data->metadata_contents = g_strdup (var_cache_data_get_metadat a (xa_data)); rev_data->metadata_contents = g_strdup (var_cache_data_get_metadat a (xa_data));
rev_data->commit_size = commit_size; rev_data->commit_size = commit_size;
rev_data->commit_timestamp = GUINT64_FROM_BE (var_metadata_lookup_ uint64 (commit_metadata, OSTREE_COMMIT_TIMESTAMP2, 0));
/* Get sparse data */ /* Get sparse data */
gsize len = var_metadata_get_length (commit_metadata); gsize len = var_metadata_get_length (commit_metadata);
for (gsize k = 0; k < len; k++) for (gsize k = 0; k < len; k++)
{ {
VarMetadataEntryRef m = var_metadata_get_at (commit_metadata, k); VarMetadataEntryRef m = var_metadata_get_at (commit_metadata, k);
const char *m_key = var_metadata_entry_get_key (m); const char *m_key = var_metadata_entry_get_key (m);
if (!g_str_has_prefix (m_key, "ostree.") && strcmp (m_key, "xa if (!g_str_has_prefix (m_key, "ot.") &&
.data") != 0) !g_str_has_prefix (m_key, "ostree.") &&
strcmp (m_key, "xa.data") != 0)
{ {
VarVariantRef v = var_metadata_entry_get_value (m); VarVariantRef v = var_metadata_entry_get_value (m);
GVariant *vv = var_variant_dup_to_gvariant (v); GVariant *vv = var_variant_dup_to_gvariant (v);
g_variant_builder_add (&sparse_builder, "{sv}", m_key, g_v ariant_get_child_value (vv, 0)); g_variant_builder_add (&sparse_builder, "{sv}", m_key, g_v ariant_get_child_value (vv, 0));
has_sparse = TRUE; has_sparse = TRUE;
} }
} }
if (has_sparse) if (has_sparse)
rev_data->sparse_data = g_variant_ref_sink (g_variant_builder_en d (&sparse_builder)); rev_data->sparse_data = g_variant_ref_sink (g_variant_builder_en d (&sparse_builder));
skipping to change at line 3376 skipping to change at line 3380
} }
flatpak_repo_collect_extra_data_sizes (repo, rev, &installed_size, &download_s ize); flatpak_repo_collect_extra_data_sizes (repo, rev, &installed_size, &download_s ize);
rev_data = g_new0 (CommitData, 1); rev_data = g_new0 (CommitData, 1);
rev_data->installed_size = installed_size; rev_data->installed_size = installed_size;
rev_data->download_size = download_size; rev_data->download_size = download_size;
rev_data->metadata_contents = g_steal_pointer (&metadata_contents); rev_data->metadata_contents = g_steal_pointer (&metadata_contents);
rev_data->subsets = g_steal_pointer (&subsets); rev_data->subsets = g_steal_pointer (&subsets);
rev_data->commit_size = g_variant_get_size (commit_v); rev_data->commit_size = g_variant_get_size (commit_v);
rev_data->commit_timestamp = ostree_commit_get_timestamp (commit_v);
g_variant_lookup (commit_metadata, OSTREE_COMMIT_META_KEY_ENDOFLIFE, "&s", &eo l); g_variant_lookup (commit_metadata, OSTREE_COMMIT_META_KEY_ENDOFLIFE, "&s", &eo l);
g_variant_lookup (commit_metadata, OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE, "& s", &eol_rebase); g_variant_lookup (commit_metadata, OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE, "& s", &eol_rebase);
if (g_variant_lookup (commit_metadata, "xa.token-type", "i", &token_type)) if (g_variant_lookup (commit_metadata, "xa.token-type", "i", &token_type))
token_type = GINT32_FROM_LE(token_type); token_type = GINT32_FROM_LE(token_type);
extra_data_sources = flatpak_commit_get_extra_data_sources (commit_v, NULL); extra_data_sources = flatpak_commit_get_extra_data_sources (commit_v, NULL);
if (extra_data_sources) if (extra_data_sources)
{ {
n_extra_data = g_variant_n_children (extra_data_sources); n_extra_data = g_variant_n_children (extra_data_sources);
skipping to change at line 4308 skipping to change at line 4313
} }
/* Create refs list, metadata and sparse_data */ /* Create refs list, metadata and sparse_data */
for (l = ordered_keys; l; l = l->next) for (l = ordered_keys; l; l = l->next)
{ {
const char *ref = l->data; const char *ref = l->data;
const char *rev = g_hash_table_lookup (refs, ref); const char *rev = g_hash_table_lookup (refs, ref);
const CommitData *rev_data = NULL; const CommitData *rev_data = NULL;
g_auto(GVariantDict) commit_metadata_builder = FLATPAK_VARIANT_BUILDER_INI TIALIZER; g_auto(GVariantDict) commit_metadata_builder = FLATPAK_VARIANT_BUILDER_INI TIALIZER;
guint64 commit_size; guint64 commit_size;
guint64 commit_timestamp;
if (!g_hash_table_contains (commits, rev)) if (!g_hash_table_contains (commits, rev))
continue; /* Filter out commit (by arch & subset) */ continue; /* Filter out commit (by arch & subset) */
if (is_flatpak_ref (ref)) if (is_flatpak_ref (ref))
rev_data = g_hash_table_lookup (commit_data_cache, rev); rev_data = g_hash_table_lookup (commit_data_cache, rev);
if (rev_data != NULL) if (rev_data != NULL)
commit_size = rev_data->commit_size; {
commit_size = rev_data->commit_size;
commit_timestamp = rev_data->commit_timestamp;
}
else else
{ {
g_autoptr(GVariant) commit_obj = NULL; g_autoptr(GVariant) commit_obj = NULL;
if (!ostree_repo_load_variant (repo, OSTREE_OBJECT_TYPE_COMMIT, rev, & commit_obj, error)) if (!ostree_repo_load_variant (repo, OSTREE_OBJECT_TYPE_COMMIT, rev, & commit_obj, error))
return NULL; return NULL;
commit_size = g_variant_get_size (commit_obj); commit_size = g_variant_get_size (commit_obj);
commit_timestamp = ostree_commit_get_timestamp (commit_obj);
} }
g_variant_dict_init (&commit_metadata_builder, NULL); g_variant_dict_init (&commit_metadata_builder, NULL);
if (!compat_format && rev_data) if (!compat_format && rev_data)
{ {
g_variant_dict_insert (&commit_metadata_builder, "xa.data", "(tts)", g_variant_dict_insert (&commit_metadata_builder, "xa.data", "(tts)",
GUINT64_TO_BE (rev_data->installed_size), GUINT64_TO_BE (rev_data->installed_size),
GUINT64_TO_BE (rev_data->download_size), GUINT64_TO_BE (rev_data->download_size),
rev_data->metadata_contents); rev_data->metadata_contents);
variant_dict_merge (&commit_metadata_builder, rev_data->sparse_data); variant_dict_merge (&commit_metadata_builder, rev_data->sparse_data);
} }
/* For the new format summary we use a shorter name for the timestamp to s
ave space */
g_variant_dict_insert_value (&commit_metadata_builder,
compat_format ? OSTREE_COMMIT_TIMESTAMP : OS
TREE_COMMIT_TIMESTAMP2,
g_variant_new_uint64 (GUINT64_TO_BE (commit_t
imestamp)));
g_variant_builder_add_value (refs_builder, g_variant_builder_add_value (refs_builder,
g_variant_new ("(s(t@ay@a{sv}))", ref, g_variant_new ("(s(t@ay@a{sv}))", ref,
commit_size, commit_size,
ostree_checksum_to_bytes_v (re v), ostree_checksum_to_bytes_v (re v),
g_variant_dict_end (&commit_me tadata_builder))); g_variant_dict_end (&commit_me tadata_builder)));
if (compat_format && rev_data) if (compat_format && rev_data)
{ {
g_variant_builder_add (ref_data_builder, "{s(tts)}", g_variant_builder_add (ref_data_builder, "{s(tts)}",
ref, ref,
 End of changes. 8 change blocks. 
3 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)