1
0
Dominique Leuenberger 2017-12-06 07:49:46 +00:00 committed by Git OBS Bridge
commit 716971e960
3 changed files with 82 additions and 7 deletions

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sun Nov 26 12:27:37 UTC 2017 - zaitor@opensuse.org
- Add gs-add-locking-to-the-repos-plugin.patch: Add locking to the
repos plugin so that we don't modify the priv->urls hash table
concurrently from multiple threads (rh#1516536).
- Run spec-cleaner, modernize spec, use autosetup macro, no longer
rm la files, not needed as we are using meson buildsystem.
- Drop update-desktop-files BuildRequires and no longer use
suse_update_desktop_file macro, no longer needed.
- Explicitly pass enable-ubuntuone=false to meson.
-------------------------------------------------------------------
Wed Nov 22 10:03:45 UTC 2017 - badshah400@gmail.com

View File

@ -24,13 +24,14 @@ Summary: GNOME Software Store
License: GPL-2.0+
Group: System/GUI/GNOME
Url: https://wiki.gnome.org/Design/Apps/Software
Source: http://download.gnome.org/sources/gnome-software/3.26/%{name}-%{version}.tar.xz
Source0: http://download.gnome.org/sources/gnome-software/3.26/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM gs-add-locking-to-the-repos-plugin.patch rh#1516536 zaitor@opensuse.org -- Add locking to the repos plugin
Patch0: gs-add-locking-to-the-repos-plugin.patch
BuildRequires: gtk-doc
BuildRequires: intltool >= 0.35.0
BuildRequires: meson
BuildRequires: pkgconfig
BuildRequires: suse-xsl-stylesheets
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(appstream-glib) >= 0.7.0
BuildRequires: pkgconfig(flatpak) >= 0.8.0
BuildRequires: pkgconfig(fwupd) >= 0.9.7
@ -69,11 +70,12 @@ GNOME software store plugins.
%lang_package
%prep
%setup -q
%autosetup -p1
%build
%meson \
-D enable-ubuntu-reviews=false \
-D enable-ubuntuone=false \
-D enable-tests=false \
-D enable-fwupd=true \
%{nil}
@ -81,15 +83,13 @@ GNOME software store plugins.
%install
%meson_install
find %{buildroot}%{_libdir} -type f -name '*.la' -delete -print
# Test shipping gnome-software-local-file in GN
# Currently not shipped, as this is not yet functional (boo#941862)
rm %{buildroot}%{_datadir}/applications/gnome-software-local-file.desktop
%suse_update_desktop_file org.gnome.Software
%find_lang %{name}
%files
%defattr(-,root,root)
%doc COPYING
%{_bindir}/%{name}
%{_bindir}/%{name}-editor
@ -127,7 +127,6 @@ rm %{buildroot}%{_datadir}/applications/gnome-software-local-file.desktop
%{_datadir}/applications/org.gnome.Software.Editor.desktop
%files devel
%defattr(-,root,root)
%dir %{_includedir}/%{name}
%{_datadir}/gtk-doc/html/%{name}/
%dir %{_datadir}/doc/gnome-software

View File

@ -0,0 +1,64 @@
From d39f372902875f2cd762df2489e761053e94c883 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Wed, 22 Nov 2017 23:17:58 +0100
Subject: Add locking to the repos plugin
... so that we don't modify the priv->urls hash table concurrently from
multiple threads.
https://bugzilla.redhat.com/show_bug.cgi?id=1516536
---
plugins/repos/gs-plugin-repos.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/plugins/repos/gs-plugin-repos.c b/plugins/repos/gs-plugin-repos.c
index 321f05c..468a6f3 100644
--- a/plugins/repos/gs-plugin-repos.c
+++ b/plugins/repos/gs-plugin-repos.c
@@ -26,6 +26,7 @@
struct GsPluginData {
GHashTable *urls; /* origin : url */
GFileMonitor *monitor;
+ GMutex mutex;
gchar *reposdir;
gboolean valid;
};
@@ -35,6 +36,8 @@ gs_plugin_initialize (GsPlugin *plugin)
{
GsPluginData *priv = gs_plugin_alloc_data (plugin, sizeof(GsPluginData));
+ g_mutex_init (&priv->mutex);
+
/* for debugging and the self tests */
priv->reposdir = g_strdup (g_getenv ("GS_SELF_TEST_REPOS_DIR"));
if (priv->reposdir == NULL)
@@ -62,8 +65,10 @@ gs_plugin_destroy (GsPlugin *plugin)
g_hash_table_unref (priv->urls);
if (priv->monitor != NULL)
g_object_unref (priv->monitor);
+ g_mutex_clear (&priv->mutex);
}
+/* mutex must be held */
static gboolean
gs_plugin_repos_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
{
@@ -145,6 +150,7 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
{
GsPluginData *priv = gs_plugin_get_data (plugin);
g_autoptr(GFile) file = g_file_new_for_path (priv->reposdir);
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->mutex);
/* watch for changes */
priv->monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, cancellable, error);
@@ -168,6 +174,7 @@ gs_plugin_refine_app (GsPlugin *plugin,
{
GsPluginData *priv = gs_plugin_get_data (plugin);
const gchar *tmp;
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->mutex);
/* not required */
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME) == 0)
--
cgit v0.12