Update to 43.alpha

This commit is contained in:
Milan Crha 2022-07-01 12:41:08 +02:00
parent 5d7e2fdfe9
commit 4afe518acc
5 changed files with 71 additions and 500 deletions

View File

@ -1,8 +1,7 @@
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c diff -up gnome-software-43.alpha/lib/gs-appstream.c.2 gnome-software-43.alpha/lib/gs-appstream.c
index 38cc31bb5..c73adce6d 100644 --- gnome-software-43.alpha/lib/gs-appstream.c.2 2022-06-30 20:03:37.000000000 +0200
--- a/lib/gs-appstream.c +++ gnome-software-43.alpha/lib/gs-appstream.c 2022-07-01 12:01:07.781026426 +0200
+++ b/lib/gs-appstream.c @@ -1648,12 +1648,12 @@ gs_appstream_add_categories (XbSilo *sil
@@ -1626,12 +1626,12 @@ gs_appstream_add_categories (XbSilo *silo,
for (guint k = 0; k < groups->len; k++) { for (guint k = 0; k < groups->len; k++) {
const gchar *group = g_ptr_array_index (groups, k); const gchar *group = g_ptr_array_index (groups, k);
guint cnt = gs_appstream_count_component_for_groups (silo, group); guint cnt = gs_appstream_count_component_for_groups (silo, group);
@ -18,11 +17,10 @@ index 38cc31bb5..c73adce6d 100644
} }
} }
} }
diff --git a/lib/gs-category.c b/lib/gs-category.c diff -up gnome-software-43.alpha/lib/gs-category.c.2 gnome-software-43.alpha/lib/gs-category.c
index b311c4941..4baede3bc 100644 --- gnome-software-43.alpha/lib/gs-category.c.2 2022-06-30 20:03:37.000000000 +0200
--- a/lib/gs-category.c +++ gnome-software-43.alpha/lib/gs-category.c 2022-07-01 12:01:07.781026426 +0200
+++ b/lib/gs-category.c @@ -147,17 +147,19 @@ gs_category_set_size (GsCategory *catego
@@ -147,17 +147,19 @@ gs_category_set_size (GsCategory *category, guint size)
/** /**
* gs_category_increment_size: * gs_category_increment_size:
* @category: a #GsCategory * @category: a #GsCategory
@ -45,11 +43,10 @@ index b311c4941..4baede3bc 100644
g_object_notify_by_pspec (G_OBJECT (category), obj_props[PROP_SIZE]); g_object_notify_by_pspec (G_OBJECT (category), obj_props[PROP_SIZE]);
} }
diff --git a/lib/gs-category.h b/lib/gs-category.h diff -up gnome-software-43.alpha/lib/gs-category.h.2 gnome-software-43.alpha/lib/gs-category.h
index ecd2e1e23..1e82591aa 100644 --- gnome-software-43.alpha/lib/gs-category.h.2 2022-06-30 20:03:37.000000000 +0200
--- a/lib/gs-category.h +++ gnome-software-43.alpha/lib/gs-category.h 2022-07-01 12:01:07.781026426 +0200
+++ b/lib/gs-category.h @@ -39,6 +39,7 @@ GsCategory *gs_category_find_child (GsC
@@ -39,6 +39,7 @@ GsCategory *gs_category_find_child (GsCategory *category,
GPtrArray *gs_category_get_children (GsCategory *category); GPtrArray *gs_category_get_children (GsCategory *category);
guint gs_category_get_size (GsCategory *category); guint gs_category_get_size (GsCategory *category);
@ -58,11 +55,46 @@ index ecd2e1e23..1e82591aa 100644
+ guint value); + guint value);
G_END_DECLS G_END_DECLS
diff --git a/src/gs-shell.c b/src/gs-shell.c diff -up gnome-software-43.alpha/src/gs-application.c.2 gnome-software-43.alpha/src/gs-application.c
index db449a9b0..796d7b05a 100644 --- gnome-software-43.alpha/src/gs-application.c.2 2022-06-30 20:03:37.000000000 +0200
--- a/src/gs-shell.c +++ gnome-software-43.alpha/src/gs-application.c 2022-07-01 12:02:05.799267693 +0200
+++ b/src/gs-shell.c @@ -1036,12 +1036,9 @@ gs_application_startup (GApplication *ap
@@ -107,6 +107,7 @@ struct _GsShell G_CALLBACK (gs_application_shell_loaded_cb),
app);
- gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
app->main_window = GTK_WINDOW (app->shell);
gtk_application_add_window (GTK_APPLICATION (app), app->main_window);
- app->update_monitor = gs_update_monitor_new (app, app->plugin_loader);
-
gs_application_update_software_sources_presence (application);
/* Remove possibly obsolete notifications */
@@ -1067,6 +1064,7 @@ startup_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
+ GsApplication *app = GS_APPLICATION (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
g_autoptr(GError) local_error = NULL;
@@ -1079,6 +1077,11 @@ startup_cb (GObject *source_object,
/* show the priority of each plugin */
gs_plugin_loader_dump_state (plugin_loader);
+
+ /* Setup the shell only after the plugin loader finished its setup,
+ thus all plugins are loaded and ready for the jobs. */
+ gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
+ app->update_monitor = gs_update_monitor_new (app, app->plugin_loader);
}
static void
diff -up gnome-software-43.alpha/src/gs-shell.c.2 gnome-software-43.alpha/src/gs-shell.c
--- gnome-software-43.alpha/src/gs-shell.c.2 2022-06-30 20:03:37.000000000 +0200
+++ gnome-software-43.alpha/src/gs-shell.c 2022-07-01 12:01:07.782026430 +0200
@@ -109,6 +109,7 @@ struct _GsShell
GtkWidget *primary_menu; GtkWidget *primary_menu;
GtkWidget *sub_page_header_title; GtkWidget *sub_page_header_title;
@ -70,7 +102,7 @@ index db449a9b0..796d7b05a 100644
gboolean is_narrow; gboolean is_narrow;
guint allocation_changed_cb_id; guint allocation_changed_cb_id;
@@ -165,6 +166,12 @@ gs_shell_modal_dialog_present (GsShell *shell, GtkWindow *window) @@ -167,6 +168,12 @@ gs_shell_modal_dialog_present (GsShell *
void void
gs_shell_activate (GsShell *shell) gs_shell_activate (GsShell *shell)
{ {
@ -83,7 +115,7 @@ index db449a9b0..796d7b05a 100644
gtk_widget_show (GTK_WIDGET (shell)); gtk_widget_show (GTK_WIDGET (shell));
gtk_window_present (GTK_WINDOW (shell)); gtk_window_present (GTK_WINDOW (shell));
} }
@@ -2237,6 +2244,11 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can @@ -2265,6 +2272,11 @@ gs_shell_setup (GsShell *shell, GsPlugin
if (g_settings_get_boolean (shell->settings, "first-run")) if (g_settings_get_boolean (shell->settings, "first-run"))
g_settings_set_boolean (shell->settings, "first-run", FALSE); g_settings_set_boolean (shell->settings, "first-run", FALSE);
} }
@ -95,40 +127,3 @@ index db449a9b0..796d7b05a 100644
} }
void void
diff --git a/src/gs-application.c b/src/gs-application.c
index e3f5f55c7..bdadd5c34 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -968,12 +968,9 @@ gs_application_startup (GApplication *application)
G_CALLBACK (gs_application_shell_loaded_cb),
app);
- gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
app->main_window = GTK_WINDOW (app->shell);
gtk_application_add_window (GTK_APPLICATION (app), app->main_window);
- app->update_monitor = gs_update_monitor_new (app, app->plugin_loader);
-
gs_application_update_software_sources_presence (application);
/* Set up the plugins. */
@@ -990,6 +987,7 @@ startup_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
+ GsApplication *app = GS_APPLICATION (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
g_autoptr(GError) local_error = NULL;
@@ -1002,6 +1000,11 @@ startup_cb (GObject *source_object,
/* show the priority of each plugin */
gs_plugin_loader_dump_state (plugin_loader);
+
+ /* Setup the shell only after the plugin loader finished its setup,
+ thus all plugins are loaded and ready for the jobs. */
+ gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
+ app->update_monitor = gs_update_monitor_new (app, app->plugin_loader);
}
static void

View File

@ -1,386 +0,0 @@
diff -up gnome-software-42.2/lib/gs-appstream.c.3 gnome-software-42.2/lib/gs-appstream.c
--- gnome-software-42.2/lib/gs-appstream.c.3 2022-06-13 14:34:05.477145977 +0200
+++ gnome-software-42.2/lib/gs-appstream.c 2022-06-13 14:36:26.640218337 +0200
@@ -20,7 +20,13 @@ GsApp *
gs_appstream_create_app (GsPlugin *plugin, XbSilo *silo, XbNode *component, GError **error)
{
GsApp *app;
- g_autoptr(GsApp) app_new = gs_app_new (NULL);
+ g_autoptr(GsApp) app_new = NULL;
+
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), NULL);
+ g_return_val_if_fail (XB_IS_SILO (silo), NULL);
+ g_return_val_if_fail (XB_IS_NODE (component), NULL);
+
+ app_new = gs_app_new (NULL);
/* refine enough to get the unique ID */
if (!gs_appstream_refine_app (plugin, app_new, silo, component,
@@ -967,6 +973,11 @@ gs_appstream_refine_app (GsPlugin *plugi
g_autoptr(GPtrArray) launchables = NULL;
g_autoptr(XbNode) req = NULL;
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (GS_IS_APP (app), FALSE);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (XB_IS_NODE (component), FALSE);
+
/* is compatible */
req = xb_node_query_first (component,
"requires/id[@type='id']"
@@ -1411,6 +1422,11 @@ gs_appstream_search (GsPlugin *plugin,
{ AS_SEARCH_TOKEN_MATCH_NONE, NULL }
};
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (values != NULL, FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+
/* add some weighted queries */
for (guint i = 0; queries[i].xpath != NULL; i++) {
g_autoptr(GError) error_query = NULL;
@@ -1487,6 +1503,11 @@ gs_appstream_add_category_apps (GsPlugin
{
GPtrArray *desktop_groups;
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (GS_IS_CATEGORY (category), FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+
desktop_groups = gs_category_get_desktop_groups (category);
if (desktop_groups->len == 0) {
g_warning ("no desktop_groups for %s", gs_category_get_id (category));
@@ -1577,6 +1598,9 @@ gs_appstream_add_categories (XbSilo *sil
GCancellable *cancellable,
GError **error)
{
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (list != NULL, FALSE);
+
for (guint j = 0; j < list->len; j++) {
GsCategory *parent = GS_CATEGORY (g_ptr_array_index (list, j));
GPtrArray *children = gs_category_get_children (parent);
@@ -1611,6 +1635,9 @@ gs_appstream_add_popular (XbSilo *silo,
g_autoptr(GError) error_local = NULL;
g_autoptr(GPtrArray) array = NULL;
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+
/* find out how many packages are in each category */
array = xb_silo_query (silo,
"components/component/kudos/"
@@ -1648,6 +1675,10 @@ gs_appstream_add_recent (GsPlugin *plugi
g_autoptr(GError) error_local = NULL;
g_autoptr(GPtrArray) array = NULL;
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+
/* use predicate conditions to the max */
xpath = g_strdup_printf ("components/component/releases/"
"release[@timestamp>%" G_GUINT64_FORMAT "]/../..",
@@ -1686,6 +1717,10 @@ gs_appstream_add_alternates (XbSilo *sil
g_autoptr(GPtrArray) ids = NULL;
g_autoptr(GString) xpath = g_string_new (NULL);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (GS_IS_APP (app), FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+
/* probably a package we know nothing about */
if (gs_app_get_id (app) == NULL)
return TRUE;
@@ -1743,6 +1778,9 @@ gs_appstream_add_featured (XbSilo *silo,
g_autoptr(GError) error_local = NULL;
g_autoptr(GPtrArray) array = NULL;
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+
/* find out how many packages are in each category */
array = xb_silo_query (silo,
"components/component/custom/value[@key='GnomeSoftware::FeatureTile']/../..|"
@@ -1782,6 +1820,11 @@ gs_appstream_url_to_app (GsPlugin *plugi
g_autofree gchar *xpath = NULL;
g_autoptr(GPtrArray) components = NULL;
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE);
+ g_return_val_if_fail (url != NULL, FALSE);
+
/* not us */
scheme = gs_utils_get_url_scheme (url);
if (g_strcmp0 (scheme, "appstream") != 0)
@@ -1812,6 +1855,9 @@ gs_appstream_component_add_keyword (XbBu
g_autoptr(XbBuilderNode) keyword = NULL;
g_autoptr(XbBuilderNode) keywords = NULL;
+ g_return_if_fail (XB_IS_BUILDER_NODE (component));
+ g_return_if_fail (str != NULL);
+
/* create <keywords> if it does not already exist */
keywords = xb_builder_node_get_child (component, "keywords", NULL);
if (keywords == NULL)
@@ -1831,6 +1877,9 @@ gs_appstream_component_add_provide (XbBu
g_autoptr(XbBuilderNode) provide = NULL;
g_autoptr(XbBuilderNode) provides = NULL;
+ g_return_if_fail (XB_IS_BUILDER_NODE (component));
+ g_return_if_fail (str != NULL);
+
/* create <provides> if it does not already exist */
provides = xb_builder_node_get_child (component, "provides", NULL);
if (provides == NULL)
@@ -1850,6 +1899,9 @@ gs_appstream_component_add_category (XbB
g_autoptr(XbBuilderNode) category = NULL;
g_autoptr(XbBuilderNode) categories = NULL;
+ g_return_if_fail (XB_IS_BUILDER_NODE (component));
+ g_return_if_fail (str != NULL);
+
/* create <categories> if it does not already exist */
categories = xb_builder_node_get_child (component, "categories", NULL);
if (categories == NULL)
@@ -1868,6 +1920,9 @@ gs_appstream_component_add_icon (XbBuild
{
g_autoptr(XbBuilderNode) icon = NULL;
+ g_return_if_fail (XB_IS_BUILDER_NODE (component));
+ g_return_if_fail (str != NULL);
+
/* create <icon>str</icon> if it does not already exist */
icon = xb_builder_node_get_child (component, "icon", NULL);
if (icon == NULL) {
@@ -1881,7 +1936,11 @@ gs_appstream_component_add_icon (XbBuild
void
gs_appstream_component_add_extra_info (XbBuilderNode *component)
{
- const gchar *kind = xb_builder_node_get_attr (component, "type");
+ const gchar *kind;
+
+ g_return_if_fail (XB_IS_BUILDER_NODE (component));
+
+ kind = xb_builder_node_get_attr (component, "type");
/* add the gnome-software-specific 'Addon' group and ensure they
* all have an icon set */
@@ -1927,9 +1986,14 @@ gs_appstream_component_add_extra_info (X
void
gs_appstream_component_fix_url (XbBuilderNode *component, const gchar *baseurl)
{
- const gchar *text = xb_builder_node_get_text (component);
+ const gchar *text;
g_autofree gchar *url = NULL;
+ g_return_if_fail (XB_IS_BUILDER_NODE (component));
+ g_return_if_fail (baseurl != NULL);
+
+ text = xb_builder_node_get_text (component);
+
if (text == NULL)
return;
diff -up gnome-software-42.2/plugins/flatpak/gs-flatpak.c.3 gnome-software-42.2/plugins/flatpak/gs-flatpak.c
--- gnome-software-42.2/plugins/flatpak/gs-flatpak.c.3 2022-05-30 13:43:00.000000000 +0200
+++ gnome-software-42.2/plugins/flatpak/gs-flatpak.c 2022-06-13 14:34:05.480145978 +0200
@@ -467,10 +467,18 @@ gs_flatpak_create_source (GsFlatpak *sel
}
static void
+gs_flatpak_invalidate_silo (GsFlatpak *self)
+{
+ g_rw_lock_writer_lock (&self->silo_lock);
+ if (self->silo != NULL)
+ xb_silo_invalidate (self->silo);
+ g_rw_lock_writer_unlock (&self->silo_lock);
+}
+
+static void
gs_flatpak_internal_data_changed (GsFlatpak *self)
{
g_autoptr(GMutexLocker) locker = NULL;
- g_autoptr(GRWLockWriterLocker) writer_locker = NULL;
/* drop the installed refs cache */
locker = g_mutex_locker_new (&self->installed_refs_mutex);
@@ -487,10 +495,7 @@ gs_flatpak_internal_data_changed (GsFlat
g_hash_table_remove_all (self->broken_remotes);
g_clear_pointer (&locker, g_mutex_locker_free);
- writer_locker = g_rw_lock_writer_locker_new (&self->silo_lock);
- if (self->silo)
- xb_silo_invalidate (self->silo);
- g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free);
+ gs_flatpak_invalidate_silo (self);
self->requires_full_rescan = TRUE;
}
@@ -2009,10 +2014,7 @@ gs_flatpak_refresh (GsFlatpak *self,
g_mutex_unlock (&self->installed_refs_mutex);
/* manually do this in case we created the first appstream file */
- g_rw_lock_reader_lock (&self->silo_lock);
- if (self->silo != NULL)
- xb_silo_invalidate (self->silo);
- g_rw_lock_reader_unlock (&self->silo_lock);
+ gs_flatpak_invalidate_silo (self);
/* update AppStream metadata */
if (!gs_flatpak_refresh_appstream (self, cache_age_secs, interactive, cancellable, error))
@@ -3197,6 +3199,20 @@ gs_flatpak_refine_app_unlocked (GsFlatpa
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_clear_pointer (&locker, g_rw_lock_reader_locker_free);
+ if (!gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error))
+ return FALSE;
+
+ locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
+ }
+
/* always do AppStream properties */
if (!gs_flatpak_refine_appstream (self, app, self->silo, flags, interactive, cancellable, error))
return FALSE;
@@ -3394,6 +3410,13 @@ gs_flatpak_refine_wildcard (GsFlatpak *s
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
+
/* find all apps when matching any prefixes */
xpath = g_strdup_printf ("components/component/id[text()='%s']/..", id);
components = xb_silo_query (self->silo, xpath, 0, &error_local);
@@ -3487,10 +3510,7 @@ gs_flatpak_app_remove_source (GsFlatpak
}
/* invalidate cache */
- g_rw_lock_reader_lock (&self->silo_lock);
- if (self->silo != NULL)
- xb_silo_invalidate (self->silo);
- g_rw_lock_reader_unlock (&self->silo_lock);
+ gs_flatpak_invalidate_silo (self);
gs_app_set_state (app, is_remove ? GS_APP_STATE_UNAVAILABLE : GS_APP_STATE_AVAILABLE);
@@ -3953,6 +3973,13 @@ gs_flatpak_search (GsFlatpak *self,
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
+
if (!gs_appstream_search (self->plugin, self->silo, values, list_tmp,
cancellable, error))
return FALSE;
@@ -4022,6 +4049,12 @@ gs_flatpak_add_category_apps (GsFlatpak
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
return gs_appstream_add_category_apps (self->plugin, self->silo,
category, list,
cancellable, error);
@@ -4040,6 +4073,12 @@ gs_flatpak_add_categories (GsFlatpak *se
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
return gs_appstream_add_categories (self->silo,
list, cancellable, error);
}
@@ -4058,6 +4097,12 @@ gs_flatpak_add_popular (GsFlatpak *self,
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
if (!gs_appstream_add_popular (self->silo, list_tmp,
cancellable, error))
return FALSE;
@@ -4081,6 +4126,12 @@ gs_flatpak_add_featured (GsFlatpak *self
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
if (!gs_appstream_add_featured (self->silo, list_tmp,
cancellable, error))
return FALSE;
@@ -4105,6 +4156,12 @@ gs_flatpak_add_alternates (GsFlatpak *se
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
if (!gs_appstream_add_alternates (self->silo, app, list_tmp,
cancellable, error))
return FALSE;
@@ -4129,6 +4186,12 @@ gs_flatpak_add_recent (GsFlatpak *self,
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
if (!gs_appstream_add_recent (self->plugin, self->silo, list_tmp, age,
cancellable, error))
return FALSE;
@@ -4154,6 +4217,12 @@ gs_flatpak_url_to_app (GsFlatpak *self,
return FALSE;
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
+ if (self->silo == NULL) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "failed to setup XbSilo for '%s'",
+ gs_flatpak_get_id (self));
+ return FALSE;
+ }
if (!gs_appstream_url_to_app (self->plugin, self->silo, list_tmp, url, cancellable, error))
return FALSE;

View File

@ -1,46 +0,0 @@
From 9aba963f2274e929658b632d6f6ce9c73ee83156 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Tue, 14 Jun 2022 13:04:31 +0100
Subject: [PATCH 18/18] fwupd: Fix the user action dialogs
When gnome-software was ported from appstream-glib to libappstream we
missed that the locale arguments are now swapped -- i.e. the former
specified "locale, value" and the latter specified "value, locale".
This fixes installing software on any devices that require some kind of
user-prompting to complete the update, e.g. buttons that need pressing
or cables that need replugging.
---
plugins/fwupd/gs-fwupd-app.c | 2 +-
plugins/fwupd/gs-plugin-fwupd.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/fwupd/gs-fwupd-app.c b/plugins/fwupd/gs-fwupd-app.c
index 03103a3e9..7fcbdadab 100644
--- a/plugins/fwupd/gs-fwupd-app.c
+++ b/plugins/fwupd/gs-fwupd-app.c
@@ -283,7 +283,7 @@ gs_fwupd_app_set_from_release (GsApp *app, FwupdRelease *rel)
as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT);
as_screenshot_add_image (ss, im);
if (fwupd_release_get_detach_caption (rel) != NULL)
- as_screenshot_set_caption (ss, NULL, fwupd_release_get_detach_caption (rel));
+ as_screenshot_set_caption (ss, fwupd_release_get_detach_caption (rel), NULL);
gs_app_set_action_screenshot (app, ss);
}
}
diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c
index cac6a324a..3171eb96d 100644
--- a/plugins/fwupd/gs-plugin-fwupd.c
+++ b/plugins/fwupd/gs-plugin-fwupd.c
@@ -945,7 +945,7 @@ gs_plugin_fwupd_install (GsPluginFwupd *self,
/* caption is required */
as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT);
- as_screenshot_set_caption (ss, NULL, fwupd_device_get_update_message (dev));
+ as_screenshot_set_caption (ss, fwupd_device_get_update_message (dev), NULL);
gs_app_set_action_screenshot (app, ss);
/* require the dialog */
--
2.36.1

View File

@ -10,25 +10,23 @@
%global packagekit_version 1.1.1 %global packagekit_version 1.1.1
# this is not a library version # this is not a library version
%define gs_plugin_version 18 %define gs_plugin_version 19
%global tarball_version %%(echo %{version} | tr '~' '.') %global tarball_version %%(echo %{version} | tr '~' '.')
%global __provides_exclude_from ^%{_libdir}/%{name}/plugins-%{gs_plugin_version}/.*\\.so.*$ %global __provides_exclude_from ^%{_libdir}/%{name}/plugins-%{gs_plugin_version}/.*\\.so.*$
Name: gnome-software Name: gnome-software
Version: 42.2 Version: 43.alpha
Release: 4%{?dist} Release: 1%{?dist}
Summary: A software center for GNOME Summary: A software center for GNOME
License: GPLv2+ License: GPLv2+
URL: https://wiki.gnome.org/Apps/Software URL: https://wiki.gnome.org/Apps/Software
Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Source0: https://download.gnome.org/sources/gnome-software/43/%{name}-%{tarball_version}.tar.xz
Patch01: 0001-crash-with-broken-theme.patch Patch01: 0001-crash-with-broken-theme.patch
Patch02: 0002-shell-setup-order.patch Patch02: 0002-shell-setup-order.patch
Patch03: 0003-crash-under-gs-flatpak-refine-app-unlocked.patch
Patch04: 0018-fwupd-Fix-the-user-action-dialogs.patch
BuildRequires: docbook-style-xsl BuildRequires: docbook-style-xsl
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
@ -63,6 +61,7 @@ BuildRequires: pkgconfig(xmlb) >= %{libxmlb_version}
Requires: appstream-data Requires: appstream-data
Requires: appstream%{?_isa} >= %{appstream_version} Requires: appstream%{?_isa} >= %{appstream_version}
Requires: epiphany-runtime%{?_isa}
Requires: flatpak%{?_isa} >= %{flatpak_version} Requires: flatpak%{?_isa} >= %{flatpak_version}
Requires: flatpak-libs%{?_isa} >= %{flatpak_version} Requires: flatpak-libs%{?_isa} >= %{flatpak_version}
Requires: fwupd%{?_isa} >= %{fwupd_version} Requires: fwupd%{?_isa} >= %{fwupd_version}
@ -119,6 +118,9 @@ This package includes the rpm-ostree backend.
-Dpackagekit_autoremove=true \ -Dpackagekit_autoremove=true \
-Dexternal_appstream=false \ -Dexternal_appstream=false \
-Drpm_ostree=true \ -Drpm_ostree=true \
-Dwebapps=true \
-Dhardcoded_foss_webapps=true \
-Dhardcoded_proprietary_webapps=false \
-Dtests=false -Dtests=false
%meson_build %meson_build
@ -159,13 +161,15 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Software-symbolic.svg %{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Software-symbolic.svg
%{_datadir}/icons/hicolor/scalable/actions/app-remove-symbolic.svg %{_datadir}/icons/hicolor/scalable/actions/app-remove-symbolic.svg
%{_datadir}/icons/hicolor/scalable/status/software-installed-symbolic.svg %{_datadir}/icons/hicolor/scalable/status/software-installed-symbolic.svg
%{_datadir}/metainfo/org.gnome.Software.appdata.xml %{_datadir}/metainfo/org.gnome.Software.metainfo.xml
%{_datadir}/metainfo/org.gnome.Software.Plugin.Epiphany.metainfo.xml
%{_datadir}/metainfo/org.gnome.Software.Plugin.Flatpak.metainfo.xml %{_datadir}/metainfo/org.gnome.Software.Plugin.Flatpak.metainfo.xml
%{_datadir}/metainfo/org.gnome.Software.Plugin.Fwupd.metainfo.xml %{_datadir}/metainfo/org.gnome.Software.Plugin.Fwupd.metainfo.xml
%dir %{_libdir}/gnome-software/plugins-%{gs_plugin_version} %dir %{_libdir}/gnome-software/plugins-%{gs_plugin_version}
%{_libdir}/gnome-software/libgnomesoftware.so.%{gs_plugin_version} %{_libdir}/gnome-software/libgnomesoftware.so.%{gs_plugin_version}
%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_appstream.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_appstream.so
%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_dummy.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_dummy.so
%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_epiphany.so
%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_fedora-langpacks.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_fedora-langpacks.so
%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_fedora-pkgdb-collections.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_fedora-pkgdb-collections.so
%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_flatpak.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_flatpak.so
@ -184,8 +188,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%{_sysconfdir}/xdg/autostart/org.gnome.Software.desktop %{_sysconfdir}/xdg/autostart/org.gnome.Software.desktop
%dir %{_datadir}/swcatalog %dir %{_datadir}/swcatalog
%dir %{_datadir}/swcatalog/xml %dir %{_datadir}/swcatalog/xml
%{_datadir}/swcatalog/xml/gnome-pwa-list-foss.xml
%{_datadir}/swcatalog/xml/org.gnome.Software.Curated.xml
%{_datadir}/swcatalog/xml/org.gnome.Software.Featured.xml %{_datadir}/swcatalog/xml/org.gnome.Software.Featured.xml
%{_datadir}/swcatalog/xml/org.gnome.Software.Popular.xml
%{_datadir}/dbus-1/services/org.freedesktop.PackageKit.service %{_datadir}/dbus-1/services/org.freedesktop.PackageKit.service
%{_datadir}/dbus-1/services/org.gnome.Software.service %{_datadir}/dbus-1/services/org.gnome.Software.service
%{_datadir}/gnome-shell/search-providers/org.gnome.Software-search-provider.ini %{_datadir}/gnome-shell/search-providers/org.gnome.Software-search-provider.ini
@ -207,6 +212,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%{_datadir}/gtk-doc/html/gnome-software/ %{_datadir}/gtk-doc/html/gnome-software/
%changelog %changelog
* Fri Jul 01 2022 Milan Crha <mcrha@redhat.com> - 43.alpha-1
- Update to 43.alpha
* Fri Jun 17 2022 Richard Hughes <rhughes@redhat.com> - 42.2-4 * Fri Jun 17 2022 Richard Hughes <rhughes@redhat.com> - 42.2-4
- Add patch to make fwupd user requests work - Add patch to make fwupd user requests work

View File

@ -1 +1 @@
SHA512 (gnome-software-42.2.tar.xz) = 2b231afbedb241b8957fa902c37cd85734cdb8b2071cd32ac75ae2e9e064483fe1e9e8d49f2e6df478fdd01e9c6225a85887ba2af1792a9150b89cea75ef8bb4 SHA512 (gnome-software-43.alpha.tar.xz) = 796b77e763f0ad0c8103b39563ce792b9354126762594addba38a993628f273938a27ed09b9d3c469fb9d11d7a86502960faf9c88914347ec5263e0f626dbb1e