flatpak-installation.c (flatpak-1.15.1.tar.xz) | : | flatpak-installation.c (flatpak-1.15.2.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 323 | skipping to change at line 323 | |||
install_dir = flatpak_dir_get_system_by_id (id, cancellable, error); | install_dir = flatpak_dir_get_system_by_id (id, cancellable, error); | |||
if (install_dir == NULL) | if (install_dir == NULL) | |||
return NULL; | return NULL; | |||
installation = flatpak_installation_new_for_dir (install_dir, | installation = flatpak_installation_new_for_dir (install_dir, | |||
cancellable, | cancellable, | |||
&local_error); | &local_error); | |||
if (installation == NULL) | if (installation == NULL) | |||
{ | { | |||
g_debug ("Error creating Flatpak installation: %s", local_error->message); | g_info ("Error creating Flatpak installation: %s", local_error->message); | |||
g_propagate_error (error, g_steal_pointer (&local_error)); | g_propagate_error (error, g_steal_pointer (&local_error)); | |||
} | } | |||
g_debug ("Found Flatpak installation for '%s'", id); | g_info ("Found Flatpak installation for '%s'", id); | |||
return g_steal_pointer (&installation); | return g_steal_pointer (&installation); | |||
} | } | |||
/** | /** | |||
* flatpak_installation_new_user: | * flatpak_installation_new_user: | |||
* @cancellable: (nullable): a #GCancellable | * @cancellable: (nullable): a #GCancellable | |||
* @error: return location for a #GError | * @error: return location for a #GError | |||
* | * | |||
* Creates a new #FlatpakInstallation for the per-user installation. | * Creates a new #FlatpakInstallation for the per-user installation. | |||
* | * | |||
skipping to change at line 1015 | skipping to change at line 1015 | |||
FlatpakTransactionOperation *op = l->data; | FlatpakTransactionOperation *op = l->data; | |||
GPtrArray *op_related_to_ops = flatpak_transaction_operation_get_related_t o_ops (op); /* (element-type FlatpakTransactionOperation) */ | GPtrArray *op_related_to_ops = flatpak_transaction_operation_get_related_t o_ops (op); /* (element-type FlatpakTransactionOperation) */ | |||
FlatpakTransactionOperationType type = flatpak_transaction_operation_get_o peration_type (op); | FlatpakTransactionOperationType type = flatpak_transaction_operation_get_o peration_type (op); | |||
/* There may be an uninstall op if a runtime will now be considered | /* There may be an uninstall op if a runtime will now be considered | |||
* unused after the updates | * unused after the updates | |||
*/ | */ | |||
if (type == FLATPAK_TRANSACTION_OPERATION_UNINSTALL) | if (type == FLATPAK_TRANSACTION_OPERATION_UNINSTALL) | |||
{ | { | |||
const char *ref = flatpak_transaction_operation_get_ref (op); | const char *ref = flatpak_transaction_operation_get_ref (op); | |||
g_debug ("Update transaction wants to uninstall %s", ref); | g_info ("Update transaction wants to uninstall %s", ref); | |||
continue; | continue; | |||
} | } | |||
g_hash_table_insert (*related_to_ops, | g_hash_table_insert (*related_to_ops, | |||
g_object_ref (op), | g_object_ref (op), | |||
op_related_to_ops ? g_ptr_array_ref (op_related_to_op s) : NULL); | op_related_to_ops ? g_ptr_array_ref (op_related_to_op s) : NULL); | |||
} | } | |||
g_list_free_full (ops, g_object_unref); | g_list_free_full (ops, g_object_unref); | |||
skipping to change at line 1107 | skipping to change at line 1107 | |||
const char *ref = flatpak_ref_format_ref_cached (FLATPAK_REF (installed_re f)); | const char *ref = flatpak_ref_format_ref_cached (FLATPAK_REF (installed_re f)); | |||
/* This hash table will be used later for efficient search */ | /* This hash table will be used later for efficient search */ | |||
g_hash_table_insert (installed_refs_hash, g_strdup (ref), installed_ref); | g_hash_table_insert (installed_refs_hash, g_strdup (ref), installed_ref); | |||
if (flatpak_transaction_add_update (transaction, ref, NULL, NULL, &local_e rror)) | if (flatpak_transaction_add_update (transaction, ref, NULL, NULL, &local_e rror)) | |||
continue; | continue; | |||
if (g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_REMOTE_NOT_ FOUND)) | if (g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_REMOTE_NOT_ FOUND)) | |||
{ | { | |||
g_debug ("%s: Unable to update %s: %s", G_STRFUNC, ref, local_error->m essage); | g_info ("%s: Unable to update %s: %s", G_STRFUNC, ref, local_error->me ssage); | |||
g_clear_error (&local_error); | g_clear_error (&local_error); | |||
} | } | |||
else | else | |||
{ | { | |||
g_propagate_error (error, g_steal_pointer (&local_error)); | g_propagate_error (error, g_steal_pointer (&local_error)); | |||
return NULL; | return NULL; | |||
} | } | |||
} | } | |||
eol_rebase_refs = g_ptr_array_new_with_free_func (g_free); | eol_rebase_refs = g_ptr_array_new_with_free_func (g_free); | |||
skipping to change at line 1161 | skipping to change at line 1161 | |||
/* Here we use the existing installed_refs_hash instead of get_ref() | /* Here we use the existing installed_refs_hash instead of get_ref() | |||
* since staying in memory should be more efficient than disk I/O | * since staying in memory should be more efficient than disk I/O | |||
*/ | */ | |||
installed_ref = g_hash_table_lookup (installed_refs_hash, op_ref); | installed_ref = g_hash_table_lookup (installed_refs_hash, op_ref); | |||
if (installed_ref != NULL) | if (installed_ref != NULL) | |||
{ | { | |||
if (!g_hash_table_contains (installed_refs_for_update_set, op_ref)) | if (!g_hash_table_contains (installed_refs_for_update_set, op_ref)) | |||
{ | { | |||
g_hash_table_add (installed_refs_for_update_set, (char *)op_ref); | g_hash_table_add (installed_refs_for_update_set, (char *)op_ref); | |||
g_debug ("%s: Installed ref %s needs update", G_STRFUNC, op_ref); | g_info ("%s: Installed ref %s needs update", G_STRFUNC, op_ref); | |||
g_ptr_array_add (installed_refs_for_update, | g_ptr_array_add (installed_refs_for_update, | |||
g_object_ref (installed_ref)); | g_object_ref (installed_ref)); | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
for (gsize i = 0; op_related_to_ops != NULL && i < op_related_to_ops-> len; i++) | for (gsize i = 0; op_related_to_ops != NULL && i < op_related_to_ops-> len; i++) | |||
{ | { | |||
FlatpakTransactionOperation *related_to_op = g_ptr_array_index (op _related_to_ops, i); | FlatpakTransactionOperation *related_to_op = g_ptr_array_index (op _related_to_ops, i); | |||
const char *related_op_ref = flatpak_transaction_operation_get_ref (related_to_op); | const char *related_op_ref = flatpak_transaction_operation_get_ref (related_to_op); | |||
if (!g_hash_table_contains (installed_refs_for_update_set, related _op_ref)) | if (!g_hash_table_contains (installed_refs_for_update_set, related _op_ref)) | |||
{ | { | |||
installed_ref = g_hash_table_lookup (installed_refs_hash, rela ted_op_ref); | installed_ref = g_hash_table_lookup (installed_refs_hash, rela ted_op_ref); | |||
if (installed_ref != NULL) | if (installed_ref != NULL) | |||
{ | { | |||
g_hash_table_add (installed_refs_for_update_set, (char *)r elated_op_ref); | g_hash_table_add (installed_refs_for_update_set, (char *)r elated_op_ref); | |||
g_debug ("%s: Installed ref %s needs update", G_STRFUNC, r elated_op_ref); | g_info ("%s: Installed ref %s needs update", G_STRFUNC, re lated_op_ref); | |||
g_ptr_array_add (installed_refs_for_update, | g_ptr_array_add (installed_refs_for_update, | |||
g_object_ref (installed_ref)); | g_object_ref (installed_ref)); | |||
} | } | |||
} | } | |||
} | } | |||
} | } | |||
/* Note: installed_ref could be NULL if for example op is installing a | /* Note: installed_ref could be NULL if for example op is installing a | |||
* related ref of a missing runtime. | * related ref of a missing runtime. | |||
*/ | */ | |||
skipping to change at line 1202 | skipping to change at line 1202 | |||
/* Also handle any renames since those won't be in related_to_ops */ | /* Also handle any renames since those won't be in related_to_ops */ | |||
for (guint i = 0; i < eol_rebase_refs->len; i++) | for (guint i = 0; i < eol_rebase_refs->len; i++) | |||
{ | { | |||
const char *rebased_ref = g_ptr_array_index (eol_rebase_refs, i); | const char *rebased_ref = g_ptr_array_index (eol_rebase_refs, i); | |||
FlatpakInstalledRef *installed_ref = g_hash_table_lookup (installed_refs_h ash, rebased_ref); | FlatpakInstalledRef *installed_ref = g_hash_table_lookup (installed_refs_h ash, rebased_ref); | |||
if (installed_ref != NULL) | if (installed_ref != NULL) | |||
{ | { | |||
if (!g_hash_table_contains (installed_refs_for_update_set, rebased_ref )) | if (!g_hash_table_contains (installed_refs_for_update_set, rebased_ref )) | |||
{ | { | |||
g_hash_table_add (installed_refs_for_update_set, (char *)rebased_r ef); | g_hash_table_add (installed_refs_for_update_set, (char *)rebased_r ef); | |||
g_debug ("%s: Installed ref %s needs update", G_STRFUNC, rebased_r ef); | g_info ("%s: Installed ref %s needs update", G_STRFUNC, rebased_re f); | |||
g_ptr_array_add (installed_refs_for_update, | g_ptr_array_add (installed_refs_for_update, | |||
g_object_ref (installed_ref)); | g_object_ref (installed_ref)); | |||
} | } | |||
} | } | |||
} | } | |||
/* Remove non-determinism for the sake of the unit tests */ | /* Remove non-determinism for the sake of the unit tests */ | |||
g_ptr_array_sort (installed_refs_for_update, installed_ref_compare); | g_ptr_array_sort (installed_refs_for_update, installed_ref_compare); | |||
return g_steal_pointer (&installed_refs_for_update); | return g_steal_pointer (&installed_refs_for_update); | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added |