From 44e806696472bd9b2bb5e7ceb41fa12e4572e649 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Thu, 14 Apr 2022 12:34:54 -0700 Subject: [PATCH] gnome-online-miners package is retired on c9s for CS-271 --- .gitignore | 28 - dead.package | 1 + gnome-online-miners.spec | 253 ------- sources | 1 - tracker3.patch | 1554 -------------------------------------- 5 files changed, 1 insertion(+), 1836 deletions(-) delete mode 100644 .gitignore create mode 100644 dead.package delete mode 100644 gnome-online-miners.spec delete mode 100644 sources delete mode 100644 tracker3.patch diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b5eda07..0000000 --- a/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -/gnome-online-miners-3.9.4.tar.xz -/gnome-online-miners-3.9.90.tar.xz -/gnome-online-miners-3.9.91.tar.xz -/gnome-online-miners-3.9.92.tar.xz -/gnome-online-miners-3.10.0.tar.xz -/gnome-online-miners-3.11.2.tar.xz -/gnome-online-miners-3.11.3.tar.xz -/gnome-online-miners-3.11.4.tar.xz -/gnome-online-miners-3.11.5.tar.xz -/gnome-online-miners-3.11.90.tar.xz -/gnome-online-miners-3.12.0.tar.xz -/gnome-online-miners-3.13.3.tar.xz -/gnome-online-miners-3.13.91.tar.xz -/gnome-online-miners-3.14.0.tar.xz -/gnome-online-miners-3.14.1.tar.xz -/gnome-online-miners-3.14.2.tar.xz -/gnome-online-miners-3.14.3.tar.xz -/gnome-online-miners-3.19.90.tar.xz -/gnome-online-miners-3.20.0.tar.xz -/gnome-online-miners-3.20.1.tar.xz -/gnome-online-miners-3.21.91.tar.xz -/gnome-online-miners-3.22.0.tar.xz -/gnome-online-miners-3.25.90.tar.xz -/gnome-online-miners-3.26.0.tar.xz -/gnome-online-miners-3.29.90.tar.xz -/gnome-online-miners-3.30.0.tar.xz -/gnome-online-miners-3.33.92.tar.xz -/gnome-online-miners-3.34.0.tar.xz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..b672e4f --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +gnome-online-miners package is retired on c9s for CS-271 diff --git a/gnome-online-miners.spec b/gnome-online-miners.spec deleted file mode 100644 index 4815264..0000000 --- a/gnome-online-miners.spec +++ /dev/null @@ -1,253 +0,0 @@ -%global _privatelibs libgom-1[.]0[.]so.* -%global __provides_exclude ^(%{_privatelibs})$ -%global __requires_exclude ^(%{_privatelibs})$ - -Name: gnome-online-miners -Version: 3.34.0 -Release: 9%{?dist} -Summary: Crawls through your online content - -License: GPLv2+ and LGPLv2+ and MIT -URL: https://wiki.gnome.org/Projects/GnomeOnlineMiners -Source0: https://download.gnome.org/sources/%{name}/3.34/%{name}-%{version}.tar.xz - -# https://gitlab.gnome.org/GNOME/gnome-online-miners/-/merge_requests/3 -Patch0: tracker3.patch - -# For patch0 -BuildRequires: autoconf automake libtool -BuildRequires: autoconf-archive - -BuildRequires: gfbgraph-devel -BuildRequires: glib2-devel >= 2.35.1 -BuildRequires: gnome-online-accounts-devel >= 3.8.0 -BuildRequires: grilo-devel >= 0.3.0 -BuildRequires: libgdata-devel >= 0.15.2 - -BuildRequires: make -BuildRequires: pkgconfig -BuildRequires: tracker3-devel - -Requires: dbus -Requires: grilo-plugins -Requires: gvfs >= 1.18.3 - -%description -GNOME Online Miners provides a set of crawlers that go through your online -content and index them locally in Tracker. It has miners for Facebook, Flickr, -Google, OneDrive and Nextcloud. - - -%prep -%autosetup -p1 - -%build -# For patch0 -autoreconf -fi - -%configure \ - --disable-silent-rules \ - --disable-static \ - --disable-owncloud \ - --disable-windows-live - -make %{?_smp_mflags} - - -%install -%make_install -find $RPM_BUILD_ROOT -name '*.la' -delete - -# Use %%doc instead. -rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} - -%files -%license COPYING -%doc AUTHORS -%doc NEWS -%doc README -%{_datadir}/dbus-1/services/org.gnome.OnlineMiners.Facebook.service -%{_datadir}/dbus-1/services/org.gnome.OnlineMiners.Flickr.service -%{_datadir}/dbus-1/services/org.gnome.OnlineMiners.GData.service -%{_datadir}/dbus-1/services/org.gnome.OnlineMiners.MediaServer.service - -%dir %{_libdir}/%{name} -%{_libdir}/%{name}/libgom-1.0.so - -%{_libexecdir}/gom-facebook-miner -%{_libexecdir}/gom-flickr-miner -%{_libexecdir}/gom-gdata-miner -%{_libexecdir}/gom-media-server-miner - - -%changelog -* Thu Apr 15 2021 Mohan Boddu - 3.34.0-9 -- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - -* Tue Mar 16 2021 Debarshi Ray - 3.34.0-8 -- Disable unused gnome-documents-specific miners - -* Mon Mar 15 2021 Kalev Lember - 3.34.0-7 -- Backport patches for Tracker 3 support - -* Tue Jan 26 2021 Fedora Release Engineering - 3.34.0-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jan 06 2021 Debarshi Ray - 3.34.0-5 -- Disable unused gnome-documents-specific miners from RHEL - -* Sat Aug 01 2020 Fedora Release Engineering - 3.34.0-4 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon Jul 27 2020 Fedora Release Engineering - 3.34.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jan 28 2020 Fedora Release Engineering - 3.34.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Wed Sep 11 2019 Kalev Lember - 3.34.0-1 -- Update to 3.34.0 - -* Tue Sep 03 2019 Kalev Lember - 3.33.92-1 -- Update to 3.33.92 - -* Thu Jul 25 2019 Fedora Release Engineering - 3.30.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Thu Jan 31 2019 Fedora Release Engineering - 3.30.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Thu Sep 06 2018 Kalev Lember - 3.30.0-1 -- Update to 3.30.0 - -* Mon Aug 13 2018 Kalev Lember - 3.29.90-1 -- Update to 3.29.90 - -* Fri Jul 13 2018 Fedora Release Engineering - 3.26.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Wed Feb 07 2018 Fedora Release Engineering - 3.26.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Mon Sep 11 2017 Kalev Lember - 3.26.0-1 -- Update to 3.26.0 - -* Wed Aug 09 2017 Debarshi Ray - 3.25.90-1 -- Update to 3.25.90 - -* Wed Aug 02 2017 Fedora Release Engineering - 3.22.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 3.22.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 3.22.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Sep 19 2016 Kalev Lember - 3.22.0-1 -- Update to 3.22.0 - -* Tue Sep 06 2016 Kalev Lember - 3.21.91-1 -- Update to 3.21.91 -- Use license macro for COPYING - -* Fri Sep 02 2016 Debarshi Ray - 3.20.1-1 -- Update to 3.20.1 - -* Tue Mar 22 2016 Kalev Lember - 3.20.0-1 -- Update to 3.20.0 - -* Wed Feb 17 2016 Richard Hughes - 3.19.90-1 -- Update to 3.19.90 - -* Wed Feb 03 2016 Fedora Release Engineering - 3.14.3-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Fri Dec 18 2015 Kalev Lember - 3.14.3-4 -- Build with grilo 0.3 -- Use make_install macro - -* Wed Jun 17 2015 Fedora Release Engineering - 3.14.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Thu May 28 2015 Debarshi Ray - 3.14.3-2 -- Release bump to retain the upgrade path - -* Mon May 04 2015 Debarshi Ray - 3.14.3-1 -- Update to 3.14.3 - -* Tue Apr 28 2015 Debarshi Ray - 3.14.2-2 -- Rebuild for libgdata soname bump - -* Tue Apr 14 2015 Debarshi Ray - 3.14.2-1 -- Update to 3.14.2 - -* Tue Dec 16 2014 Debarshi Ray - 3.14.1-1 -- Update to 3.14.1 -- Bump libgdata BuildRequires to reflect reality - -* Wed Sep 24 2014 Kalev Lember - 3.14.0-1 -- Update to 3.14.0 -- Ship NEWS instead of ChangeLog - -* Wed Sep 03 2014 Kalev Lember - 3.13.91-1 -- Update to 3.13.91 - -* Sat Aug 16 2014 Fedora Release Engineering - 3.13.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Wed Jun 25 2014 Richard Hughes - 3.13.3-1 -- Update to 3.13.3 - -* Sat Jun 07 2014 Fedora Release Engineering - 3.12.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Wed Apr 16 2014 Adam Williamson - 3.12.0-2 -- rebuild for new libgdata - -* Sun Mar 23 2014 Kalev Lember - 3.12.0-1 -- Update to 3.12.0 - -* Wed Feb 19 2014 Kalev Lember - 3.11.90-1 -- Update to 3.11.90 - -* Tue Feb 04 2014 Richard Hughes - 3.11.5-1 -- Update to 3.11.5 - -* Mon Jan 20 2014 Debarshi Ray - 3.11.4-1 -- Update to 3.11.4. - -* Tue Dec 17 2013 Richard Hughes - 3.11.3-1 -- Update to 3.11.3 - -* Fri Nov 22 2013 Debarshi Ray - 3.11.2-1 -- Update to 3.11.2. - -* Fri Nov 22 2013 Debarshi Ray - 3.10.2-1 -- Update to 3.10.2. - -* Wed Sep 25 2013 Kalev Lember - 3.10.0-1 -- Update to 3.10.0 - -* Wed Sep 18 2013 Kalev Lember - 3.9.92-1 -- Update to 3.9.92 - -* Tue Sep 03 2013 Kalev Lember - 3.9.91-1 -- Update to 3.9.91 - -* Thu Aug 22 2013 Debarshi Ray - 3.9.90-1 -- Update to 3.9.90. - -* Sat Aug 03 2013 Fedora Release Engineering - 3.9.4-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Fri Jul 19 2013 Debarshi Ray - 3.9.4-3 -- Filter out the private library from requires. - -* Fri Jul 19 2013 Debarshi Ray - 3.9.4-2 -- Use %%{_libexecdir}. -- Filter out the private library from provides. - -* Tue Jul 09 2013 Debarshi Ray - 3.9.4-1 -- Initial spec. diff --git a/sources b/sources deleted file mode 100644 index c66f8fd..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (gnome-online-miners-3.34.0.tar.xz) = bfcdd7f11607663eda491314c34a9b50f2885f6fb39e7c9e68a77927bbcc326979fb8900ab5dfac1494ac575dbf0e3f3b7459ec3f38cb1eb8961158e3fe44464 diff --git a/tracker3.patch b/tracker3.patch deleted file mode 100644 index c948f65..0000000 --- a/tracker3.patch +++ /dev/null @@ -1,1554 +0,0 @@ -From 53869ebc2783c9d08bb32d59c543ab692770c121 Mon Sep 17 00:00:00 2001 -From: Sam Thursfield -Date: Fri, 15 May 2020 01:11:24 +0200 -Subject: [PATCH 1/5] Use GInitable interface for GomMiner class - -This allows for better error reporting. ---- - src/gom-application.c | 7 +++++- - src/gom-miner.c | 58 +++++++++++++++++++++++++++++-------------- - 2 files changed, 45 insertions(+), 20 deletions(-) - -diff --git a/src/gom-application.c b/src/gom-application.c -index fadd388..bfa99ec 100644 ---- a/src/gom-application.c -+++ b/src/gom-application.c -@@ -229,10 +229,15 @@ gom_application_constructed (GObject *object) - { - GomApplication *self = GOM_APPLICATION (object); - const gchar *display_name; -+ GError *error = NULL; - - G_OBJECT_CLASS (gom_application_parent_class)->constructed (object); - -- self->miner = g_object_new (self->miner_type, NULL); -+ self->miner = g_initable_new (self->miner_type, NULL, &error, NULL); -+ -+ if (self->miner == NULL) -+ g_error ("%s", error->message); -+ - display_name = gom_miner_get_display_name (self->miner); - gom_dbus_set_display_name (self->skeleton, display_name); - } -diff --git a/src/gom-miner.c b/src/gom-miner.c -index 7147b33..1dd9bb8 100644 ---- a/src/gom-miner.c -+++ b/src/gom-miner.c -@@ -28,7 +28,11 @@ - - #include "gom-miner.h" - --G_DEFINE_TYPE (GomMiner, gom_miner, G_TYPE_OBJECT) -+static void gom_miner_initable_interface_init (GInitableIface *iface); -+ -+G_DEFINE_TYPE_WITH_CODE (GomMiner, gom_miner, G_TYPE_OBJECT, -+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gom_miner_initable_interface_init)) -+ - - struct _GomMinerPrivate { - GoaClient *client; -@@ -132,20 +136,21 @@ gom_miner_dispose (GObject *object) - } - - static void --gom_miner_init_goa (GomMiner *self) -+gom_miner_init_goa (GomMiner *self, -+ GError **error) - { - GoaAccount *account; - GoaObject *object; - const gchar *provider_type; - GList *accounts, *l; - GomMinerClass *miner_class = GOM_MINER_GET_CLASS (self); -+ GError *inner_error = NULL; - -- self->priv->client = goa_client_new_sync (NULL, &self->priv->client_error); -+ self->priv->client = goa_client_new_sync (NULL, &inner_error); - -- if (self->priv->client_error != NULL) -+ if (inner_error) - { -- g_critical ("Unable to create GoaClient: %s - indexing for %s will not work", -- self->priv->client_error->message, miner_class->goa_provider_type); -+ g_propagate_error (error, inner_error); - return; - } - -@@ -170,16 +175,34 @@ gom_miner_init_goa (GomMiner *self) - g_list_free_full (accounts, g_object_unref); - } - --static void --gom_miner_constructed (GObject *obj) -+static gboolean -+gom_miner_initable_init (GInitable *initable, -+ GCancellable *cancellable, -+ GError **error) - { -- GomMiner *self = GOM_MINER (obj); -+ GError *inner_error = NULL; -+ GomMiner *self; - -- G_OBJECT_CLASS (gom_miner_parent_class)->constructed (obj); -+ self = GOM_MINER (initable); - -- gom_miner_init_goa (self); -+ self->priv->connection = tracker_sparql_connection_get (cancellable, &inner_error); -+ if (inner_error) -+ { -+ g_propagate_prefixed_error (error, inner_error, "Unable to connect to Tracker store: "); -+ return FALSE; -+ } -+ -+ gom_miner_init_goa (self, &inner_error); -+ if (inner_error) -+ { -+ g_propagate_prefixed_error (error, inner_error, "Unable to connect to GNOME Online Accounts: "); -+ return FALSE; -+ } -+ -+ return TRUE; - } - -+ - static void - gom_miner_init (GomMiner *self) - { -@@ -187,14 +210,12 @@ gom_miner_init (GomMiner *self) - - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GOM_TYPE_MINER, GomMinerPrivate); - self->priv->display_name = g_strdup (""); -+} - -- self->priv->connection = tracker_sparql_connection_get (NULL, &self->priv->connection_error); -- if (self->priv->connection_error != NULL) -- { -- g_critical ("Unable to create TrackerSparqlConnection: %s - indexing for %s will not work", -- self->priv->connection_error->message, -- klass->goa_provider_type); -- } -+static void -+gom_miner_initable_interface_init (GInitableIface *iface) -+{ -+ iface->init = gom_miner_initable_init; - } - - static void -@@ -202,7 +223,6 @@ gom_miner_class_init (GomMinerClass *klass) - { - GObjectClass *oclass = G_OBJECT_CLASS (klass); - -- oclass->constructed = gom_miner_constructed; - oclass->dispose = gom_miner_dispose; - - cleanup_pool = g_thread_pool_new (cleanup_job, NULL, 1, FALSE, NULL); --- -GitLab - - -From a2b53970e1c1486a61a1522010e345732ed6ca54 Mon Sep 17 00:00:00 2001 -From: Sam Thursfield -Date: Fri, 15 May 2020 01:19:58 +0200 -Subject: [PATCH 2/5] Initial port to Tracker 3 - -Each miner now stores its data in a private Tracker database, under -the $XDG_CACHE_HOME/gnome-online-miners/$busname directory. - -Each miner now supports the org.freedesktop.Tracker3.Endpoint D-Bus -interface which apps can use to query data directly from the miners. ---- - configure.ac | 4 +- - src/gom-application.c | 4 +- - src/gom-miner.c | 120 +++++++++++++++++++++++++++++++++++++++++- - src/gom-miner.h | 1 + - src/gom-tracker.c | 2 +- - 5 files changed, 125 insertions(+), 6 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e91e4af..8ee6315 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -21,7 +21,7 @@ AC_HEADER_STDC - - GDATA_MIN_VERSION=0.15.2 - GFBGRAPH_MIN_VERSION=0.2.2 --GLIB_MIN_VERSION=2.35.1 -+GLIB_MIN_VERSION=2.56.0 - GOA_MIN_VERSION=3.13.3 - GRILO_MIN_VERSION=0.3.0 - ZAPOJIT_MIN_VERSION=0.0.2 -@@ -36,7 +36,7 @@ PKG_CHECK_MODULES(GIO, [gio-2.0 gio-unix-2.0]) - PKG_CHECK_MODULES(GOA, [goa-1.0 >= $GOA_MIN_VERSION]) - AC_DEFINE([GOA_API_IS_SUBJECT_TO_CHANGE], [], [We are aware that GOA's API can change]) - --PKG_CHECK_MODULES(TRACKER, [tracker-miner-2.0 tracker-sparql-2.0]) -+PKG_CHECK_MODULES(TRACKER, [tracker-sparql-3.0]) - - # Facebook - AC_ARG_ENABLE([facebook], [AS_HELP_STRING([--enable-facebook], [Enable Facebook miner])], [], [enable_facebook=yes]) -diff --git a/src/gom-application.c b/src/gom-application.c -index bfa99ec..86546ed 100644 ---- a/src/gom-application.c -+++ b/src/gom-application.c -@@ -233,7 +233,9 @@ gom_application_constructed (GObject *object) - - G_OBJECT_CLASS (gom_application_parent_class)->constructed (object); - -- self->miner = g_initable_new (self->miner_type, NULL, &error, NULL); -+ self->miner = g_initable_new (self->miner_type, NULL, &error, -+ "bus-name", g_application_get_application_id (G_APPLICATION (self)), -+ NULL); - - if (self->miner == NULL) - g_error ("%s", error->message); -diff --git a/src/gom-miner.c b/src/gom-miner.c -index 1dd9bb8..f349d01 100644 ---- a/src/gom-miner.c -+++ b/src/gom-miner.c -@@ -38,7 +38,9 @@ struct _GomMinerPrivate { - GoaClient *client; - GError *client_error; - -+ gchar *bus_name; - TrackerSparqlConnection *connection; -+ TrackerEndpointDBus *endpoint; - GError *connection_error; - - gchar *display_name; -@@ -62,6 +64,14 @@ typedef struct { - gpointer service; - } InsertSharedContentData; - -+typedef enum -+{ -+ PROP_BUS_NAME = 1, -+ N_PROPERTIES -+} GomMinerProperty; -+ -+static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, }; -+ - static GThreadPool *cleanup_pool; - - static void cleanup_job (gpointer data, gpointer user_data); -@@ -135,6 +145,58 @@ gom_miner_dispose (GObject *object) - G_OBJECT_CLASS (gom_miner_parent_class)->dispose (object); - } - -+static void -+gom_miner_init_database (GomMiner *self, -+ GCancellable *cancellable, -+ GError **error) -+{ -+ TrackerSparqlConnectionFlags flags; -+ g_autoptr (GFile) store_path = NULL; -+ g_autoptr (GDBusConnection) bus = NULL; -+ GError *inner_error = NULL; -+ -+ flags = TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STEMMER | -+ TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT | -+ TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS | -+ TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS; -+ -+ store_path = g_file_new_build_filename (g_get_user_cache_dir (), -+ "gnome-online-miners", -+ self->priv->bus_name, -+ NULL); -+ -+ self->priv->connection = tracker_sparql_connection_new (flags, -+ store_path, -+ tracker_sparql_get_ontology_nepomuk (), -+ cancellable, -+ &inner_error); -+ -+ if (inner_error) -+ { -+ g_propagate_error (error, inner_error); -+ return; -+ } -+ -+ bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &inner_error); -+ -+ if (inner_error) -+ { -+ g_propagate_error (error, inner_error); -+ return; -+ } -+ -+ self->priv->endpoint = tracker_endpoint_dbus_new (self->priv->connection, -+ bus, -+ NULL, /* object path */ -+ cancellable, -+ &inner_error); -+ if (inner_error) -+ { -+ g_propagate_error (error, inner_error); -+ return; -+ } -+} -+ - static void - gom_miner_init_goa (GomMiner *self, - GError **error) -@@ -185,10 +247,10 @@ gom_miner_initable_init (GInitable *initable, - - self = GOM_MINER (initable); - -- self->priv->connection = tracker_sparql_connection_get (cancellable, &inner_error); -+ gom_miner_init_database (self, cancellable, &inner_error); - if (inner_error) - { -- g_propagate_prefixed_error (error, inner_error, "Unable to connect to Tracker store: "); -+ g_propagate_prefixed_error (error, inner_error, "Unable to set up Tracker database: "); - return FALSE; - } - -@@ -212,6 +274,47 @@ gom_miner_init (GomMiner *self) - self->priv->display_name = g_strdup (""); - } - -+static void -+gom_miner_set_property (GObject *object, -+ guint property_id, -+ const GValue *value, -+ GParamSpec *pspec) -+{ -+ GomMiner *self = GOM_MINER (object); -+ -+ switch ((GomMinerProperty) property_id) -+ { -+ case PROP_BUS_NAME: -+ g_free (self->priv->bus_name); -+ self->priv->bus_name = g_value_dup_string (value); -+ break; -+ -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -+ break; -+ } -+} -+ -+static void -+gom_miner_get_property (GObject *object, -+ guint property_id, -+ GValue *value, -+ GParamSpec *pspec) -+{ -+ GomMiner *self = GOM_MINER (object); -+ -+ switch ((GomMinerProperty) property_id) -+ { -+ case PROP_BUS_NAME: -+ g_value_set_string (value, self->priv->bus_name); -+ break; -+ -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -+ break; -+ } -+} -+ - static void - gom_miner_initable_interface_init (GInitableIface *iface) - { -@@ -224,6 +327,19 @@ gom_miner_class_init (GomMinerClass *klass) - GObjectClass *oclass = G_OBJECT_CLASS (klass); - - oclass->dispose = gom_miner_dispose; -+ oclass->set_property = gom_miner_set_property; -+ oclass->get_property = gom_miner_get_property; -+ -+ obj_properties[PROP_BUS_NAME] = g_param_spec_string ("bus-name", -+ "Bus Name", -+ "D-Bus name of the miner", -+ NULL /* default value */, -+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | -+ G_PARAM_STATIC_STRINGS); -+ -+ g_object_class_install_properties (oclass, -+ N_PROPERTIES, -+ obj_properties); - - cleanup_pool = g_thread_pool_new (cleanup_job, NULL, 1, FALSE, NULL); - -diff --git a/src/gom-miner.h b/src/gom-miner.h -index 8f83139..5dcfc8d 100644 ---- a/src/gom-miner.h -+++ b/src/gom-miner.h -@@ -61,6 +61,7 @@ typedef struct _GomMinerPrivate GomMinerPrivate; - typedef struct { - GomMiner *miner; - TrackerSparqlConnection *connection; -+ gchar *bus_name; - - GoaAccount *account; - GHashTable *services; -diff --git a/src/gom-tracker.c b/src/gom-tracker.c -index 68818c4..5666c16 100644 ---- a/src/gom-tracker.c -+++ b/src/gom-tracker.c -@@ -408,7 +408,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection - gchar *retval = NULL; - gchar *select = NULL; - -- g_return_val_if_fail (TRACKER_SPARQL_IS_CONNECTION (connection), NULL); -+ g_return_val_if_fail (TRACKER_IS_SPARQL_CONNECTION (connection), NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - g_return_val_if_fail (make != NULL || model != NULL, NULL); --- -GitLab - - -From 3e77eff8a677c1ecd9aa129094ed857da802d787 Mon Sep 17 00:00:00 2001 -From: Sam Thursfield -Date: Fri, 15 May 2020 01:37:28 +0200 -Subject: [PATCH 3/5] Add DataObject class to our resources - -We need this to set nie:dataSource property. I don't understand -how this worked in the past. ---- - src/gom-tracker.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/gom-tracker.c b/src/gom-tracker.c -index 5666c16..63a4c29 100644 ---- a/src/gom-tracker.c -+++ b/src/gom-tracker.c -@@ -208,7 +208,7 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection - insert = g_string_new (NULL); - g_string_append_printf - (insert, -- "INSERT OR REPLACE %s { <%s> a nie:InformationElement ; %s %s }", -+ "INSERT OR REPLACE %s { <%s> a nie:InformationElement, nie:DataObject ; %s %s }", - graph_str, resource, property_name, quoted); - g_free (quoted); - --- -GitLab - - -From e742a60cf9dea1391d1ff409ce5696d21f423bed Mon Sep 17 00:00:00 2001 -From: Sam Thursfield -Date: Fri, 15 May 2020 02:13:11 +0200 -Subject: [PATCH 4/5] Organize data into content-based graphs - -Previously GOM used a graph per account and per resource but this -cannot be done in Tracker 3. - -In Tracker 3, each graph is stored as a separate SQLite database -and currently a maximum of ten graphs can be included in a single -query due to SQLite's limitations. - -The new layout is modelled after how tracker-miner-fs uses graphs: -we use a graph per content type (Contacts, Documents, Pictures), -plus an extra graph to store accounts and folders/collections. ---- - src/gom-facebook-miner.c | 12 ++--- - src/gom-flickr-miner.c | 24 +++++----- - src/gom-gdata-miner.c | 31 ++++++------ - src/gom-media-server-miner.c | 10 ++-- - src/gom-miner.c | 40 ++++++++++++---- - src/gom-miner.h | 1 - - src/gom-owncloud-miner.c | 22 +++++---- - src/gom-tracker.c | 93 +++++++++++++++++------------------- - src/gom-tracker.h | 14 +++++- - src/gom-zpj-miner.c | 22 ++++----- - 10 files changed, 150 insertions(+), 119 deletions(-) - -diff --git a/src/gom-facebook-miner.c b/src/gom-facebook-miner.c -index ff42ca5..fc89096 100644 ---- a/src/gom-facebook-miner.c -+++ b/src/gom-facebook-miner.c -@@ -70,7 +70,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_PICTURES_GRAPH, identifier, - "nfo:RemoteDataObject", class, NULL); - - if (*error != NULL) -@@ -239,7 +239,7 @@ account_miner_job_process_album (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:url", album_link); - - if (*error != NULL) -@@ -248,7 +248,7 @@ account_miner_job_process_album (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:description", album_description); - - if (*error != NULL) -@@ -257,7 +257,7 @@ account_miner_job_process_album (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:title", album_name); - - if (*error != NULL) -@@ -274,7 +274,7 @@ account_miner_job_process_album (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nco:creator", contact_resource); - g_free (contact_resource); - -@@ -284,7 +284,7 @@ account_miner_job_process_album (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:contentCreated", album_created_time); - - if (*error != NULL) -diff --git a/src/gom-flickr-miner.c b/src/gom-flickr-miner.c -index 9ac338e..dc7349e 100644 ---- a/src/gom-flickr-miner.c -+++ b/src/gom-flickr-miner.c -@@ -143,14 +143,14 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_PICTURES_GRAPH, identifier, - "nfo:RemoteDataObject", class, NULL); - - if (*error != NULL) - goto out; - - gom_tracker_update_datasource (connection, datasource_urn, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -166,7 +166,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - parent_resource_urn = gom_tracker_sparql_connection_ensure_resource - (connection, cancellable, error, - NULL, -- datasource_urn, parent_identifier, -+ TRACKER_PICTURES_GRAPH, parent_identifier, - "nfo:RemoteDataObject", "nfo:DataContainer", NULL); - g_free (parent_identifier); - -@@ -176,7 +176,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:isPartOf", parent_resource_urn); - g_free (parent_resource_urn); - -@@ -187,7 +187,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:title", grl_media_get_title (entry->media)); - - if (*error != NULL) -@@ -202,7 +202,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - created_time = modification_date = grl_media_get_creation_date (entry->media); - new_mtime = g_date_time_to_unix (modification_date); - mtime_changed = gom_tracker_update_mtime (connection, new_mtime, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -221,7 +221,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:contentCreated", date); - g_free (date); - } -@@ -233,7 +233,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:url", url); - - if (*error != NULL) -@@ -242,7 +242,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:description", grl_media_get_description (entry->media)); - - if (*error != NULL) -@@ -254,7 +254,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:mimeType", mime); - g_free (mime); - -@@ -265,7 +265,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - contact_resource = gom_tracker_utils_ensure_contact_resource - (connection, - cancellable, error, -- datasource_urn, grl_media_get_author (entry->media)); -+ TRACKER_PICTURES_GRAPH, grl_media_get_author (entry->media)); - - if (*error != NULL) - goto out; -@@ -273,7 +273,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nco:creator", contact_resource); - g_free (contact_resource); - -diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c -index 7872431..d0deb80 100644 ---- a/src/gom-gdata-miner.c -+++ b/src/gom-gdata-miner.c -@@ -120,7 +120,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_DOCUMENTS_GRAPH, identifier, - "nfo:RemoteDataObject", class, NULL); - - if (*error != NULL) -@@ -187,7 +187,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection, - parent_resource_urn = gom_tracker_sparql_connection_ensure_resource - (connection, cancellable, error, - NULL, -- datasource_urn, parent_resource_id, -+ GOM_GRAPH, parent_resource_id, - "nfo:RemoteDataObject", "nfo:DataContainer", NULL); - g_free (parent_resource_id); - -@@ -219,7 +219,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection, - gom_tracker_sparql_connection_toggle_favorite - (connection, - cancellable, error, -- resource, starred); -+ TRACKER_PICTURES_GRAPH, resource, starred); - - if (*error != NULL) - goto out; -@@ -400,14 +400,14 @@ account_miner_job_process_photo (TrackerSparqlConnection *connection, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_PICTURES_GRAPH, identifier, - "nfo:RemoteDataObject", "nmm:Photo", NULL); - - if (*error != NULL) - goto out; - - gom_tracker_update_datasource (connection, datasource_urn, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - if (*error != NULL) - goto out; -@@ -566,6 +566,7 @@ account_miner_job_process_photo (TrackerSparqlConnection *connection, - equipment_resource = gom_tracker_utils_ensure_equipment_resource (connection, - cancellable, - error, -+ TRACKER_PICTURES_GRAPH, - make, - model); - -@@ -665,7 +666,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_PICTURES_GRAPH, identifier, - "nfo:RemoteDataObject", "nfo:DataContainer", - NULL); - -@@ -674,7 +675,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - - gom_tracker_update_datasource - (connection, datasource_urn, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -685,7 +686,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - */ - new_mtime = gdata_entry_get_updated (GDATA_ENTRY (album)); - mtime_changed = gom_tracker_update_mtime (connection, new_mtime, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -703,7 +704,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:url", alternate_uri); - - if (*error != NULL) -@@ -713,7 +714,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:description", summary); - - if (*error != NULL) -@@ -723,7 +724,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:title", title); - - if (*error != NULL) -@@ -743,7 +744,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nco:creator", contact_resource); - g_free (contact_resource); - -@@ -755,7 +756,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:contentCreated", date); - g_free (date); - -@@ -865,7 +866,7 @@ insert_shared_content_photos (TrackerSparqlConnection *connection, - if (!gom_tracker_sparql_connection_insert_or_replace_triple (connection, - cancellable, - &local_error, -- datasource_urn, -+ TRACKER_PICTURES_GRAPH, - source_urn, - "nie:relatedTo", - photo_resource_urn)) -@@ -878,7 +879,7 @@ insert_shared_content_photos (TrackerSparqlConnection *connection, - if (!gom_tracker_sparql_connection_insert_or_replace_triple (connection, - cancellable, - &local_error, -- datasource_urn, -+ TRACKER_PICTURES_GRAPH, - photo_resource_urn, - "nie:links", - source_urn)) -diff --git a/src/gom-media-server-miner.c b/src/gom-media-server-miner.c -index 490869e..32e08c6 100644 ---- a/src/gom-media-server-miner.c -+++ b/src/gom-media-server-miner.c -@@ -65,14 +65,14 @@ account_miner_job_process_photo (GomAccountMinerJob *job, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_PICTURES_GRAPH, identifier, - "nfo:RemoteDataObject", class, NULL); - - if (*error != NULL) - goto out; - - gom_tracker_update_datasource (connection, datasource_urn, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - if (*error != NULL) - goto out; -@@ -81,7 +81,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:url", photo->url); - - if (*error != NULL) -@@ -90,7 +90,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:mimeType", photo->mimetype); - - if (*error != NULL) -@@ -99,7 +99,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:title", photo->name); - - if (*error != NULL) -diff --git a/src/gom-miner.c b/src/gom-miner.c -index f349d01..32892fa 100644 ---- a/src/gom-miner.c -+++ b/src/gom-miner.c -@@ -376,7 +376,7 @@ gom_miner_ensure_datasource (GomMiner *self, - " <%s> a nie:DataSource ; nao:identifier \"%s\" . " - " <%s> a nie:InformationElement ; nie:rootElementOf <%s> ; nie:version \"%d\"" - "}", -- datasource_urn, -+ GOM_GRAPH, - datasource_urn, klass->miner_identifier, - root_element_urn, datasource_urn, klass->version); - -@@ -401,8 +401,8 @@ gom_account_miner_job_query_existing (GomAccountMinerJob *job, - - select = g_string_new (NULL); - g_string_append_printf (select, -- "SELECT ?urn nao:identifier(?urn) WHERE { ?urn nie:dataSource <%s> }", -- job->datasource_urn); -+ "SELECT ?urn ?id WHERE { GRAPH <%s> { ?urn nie:dataSource <%s> ; nao:identifier ?id . } }", -+ GOM_GRAPH, job->datasource_urn); - - cursor = tracker_sparql_connection_query (job->connection, - select->str, -@@ -415,9 +415,21 @@ gom_account_miner_job_query_existing (GomAccountMinerJob *job, - - while (tracker_sparql_cursor_next (cursor, cancellable, error)) - { -- g_hash_table_insert (job->previous_resources, -- g_strdup (tracker_sparql_cursor_get_string (cursor, 1, NULL)), -- g_strdup (tracker_sparql_cursor_get_string (cursor, 0, NULL))); -+ const gchar *urn, *identifier; -+ -+ urn = tracker_sparql_cursor_get_string (cursor, 0, NULL); -+ identifier = tracker_sparql_cursor_get_string (cursor, 1, NULL); -+ -+ if (identifier != NULL) -+ { -+ g_hash_table_insert (job->previous_resources, -+ g_strdup (identifier), -+ g_strdup (urn)); -+ } -+ else -+ { -+ g_warning ("Missing identifier for urn %s", urn); -+ } - } - - g_object_unref (cursor); -@@ -489,16 +501,19 @@ gom_account_miner_job (GTask *task, - if (error != NULL) - goto out; - -+ g_debug ("account miner: Querying existing accounts stored in database"); - gom_account_miner_job_query_existing (job, &error); - - if (error != NULL) - goto out; - -+ g_debug ("account miner: Querying remote server"); - gom_account_miner_job_query (job, &error); - - if (error != NULL) - goto out; - -+ g_debug ("account miner: Removing stale accounts"); - gom_account_miner_job_cleanup_previous (job, &error); - - if (error != NULL) -@@ -752,10 +767,15 @@ cleanup_job (gpointer data, - - /* find all our datasources in the tracker DB */ - select = g_string_new (NULL); -- g_string_append_printf (select, "SELECT ?datasource nie:version(?root) WHERE { " -- "?datasource a nie:DataSource . " -- "?datasource nao:identifier \"%s\" . " -- "OPTIONAL { ?root nie:rootElementOf ?datasource } }", -+ g_string_append_printf (select, -+ "SELECT ?datasource nie:version(?root) WHERE { " -+ " GRAPH <%s> { " -+ " ?datasource a nie:DataSource . " -+ " ?datasource nao:identifier \"%s\" . " -+ " OPTIONAL { ?root nie:rootElementOf ?datasource } " -+ " }" -+ "}", -+ GOM_GRAPH, - klass->miner_identifier); - - cursor = tracker_sparql_connection_query (self->priv->connection, -diff --git a/src/gom-miner.h b/src/gom-miner.h -index 5dcfc8d..8f83139 100644 ---- a/src/gom-miner.h -+++ b/src/gom-miner.h -@@ -61,7 +61,6 @@ typedef struct _GomMinerPrivate GomMinerPrivate; - typedef struct { - GomMiner *miner; - TrackerSparqlConnection *connection; -- gchar *bus_name; - - GoaAccount *account; - GHashTable *services; -diff --git a/src/gom-owncloud-miner.c b/src/gom-owncloud-miner.c -index 34d303b..623f2e1 100644 ---- a/src/gom-owncloud-miner.c -+++ b/src/gom-owncloud-miner.c -@@ -100,14 +100,14 @@ account_miner_job_process_file (GomAccountMinerJob *job, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_DOCUMENTS_GRAPH, identifier, - "nfo:RemoteDataObject", class, NULL); - - if (*error != NULL) - goto out; - - gom_tracker_update_datasource (connection, datasource_urn, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_DOCUMENTS_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -117,7 +117,7 @@ account_miner_job_process_file (GomAccountMinerJob *job, - modification_time = g_date_time_new_from_timeval_local (&tv); - new_mtime = g_date_time_to_unix (modification_time); - mtime_changed = gom_tracker_update_mtime (connection, new_mtime, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_DOCUMENTS_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -133,7 +133,7 @@ account_miner_job_process_file (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_DOCUMENTS_GRAPH, resource, - "nie:url", uri); - - if (*error != NULL) -@@ -156,7 +156,7 @@ account_miner_job_process_file (GomAccountMinerJob *job, - parent_resource_urn = gom_tracker_sparql_connection_ensure_resource - (connection, cancellable, error, - NULL, -- datasource_urn, parent_identifier, -+ GOM_GRAPH, parent_identifier, - "nfo:RemoteDataObject", "nfo:DataContainer", NULL); - g_checksum_reset (checksum); - g_free (parent_identifier); -@@ -168,7 +168,7 @@ account_miner_job_process_file (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_DOCUMENTS_GRAPH, resource, - "nie:isPartOf", parent_resource_urn); - g_free (parent_resource_urn); - -@@ -182,7 +182,7 @@ account_miner_job_process_file (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_DOCUMENTS_GRAPH, resource, - "nie:mimeType", mime); - - if (*error != NULL) -@@ -194,7 +194,7 @@ account_miner_job_process_file (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_DOCUMENTS_GRAPH, resource, - "nfo:fileName", display_name); - - if (*error != NULL) -@@ -416,6 +416,11 @@ query_owncloud (GomAccountMinerJob *job, - mount = g_volume_get_mount (volume); - if (mount == NULL) - { -+ g_autofree gchar *volume_name; -+ -+ volume_name = g_volume_get_name (volume); -+ g_debug ("Mounting Online Account volume %s", volume_name); -+ - data.error = error; - - context = g_main_context_new (); -@@ -436,6 +441,7 @@ query_owncloud (GomAccountMinerJob *job, - } - - root = g_mount_get_root (mount); -+ g_debug ("Got volume from gnome-online-accounts: root is %s", g_file_peek_path (root)); - account_miner_job_traverse_dir (job, connection, previous_resources, datasource_urn, root, TRUE, cancellable, error); - - g_object_unref (root); -diff --git a/src/gom-tracker.c b/src/gom-tracker.c -index 63a4c29..0d1766c 100644 ---- a/src/gom-tracker.c -+++ b/src/gom-tracker.c -@@ -26,16 +26,11 @@ - #include "gom-tracker.h" - #include "gom-utils.h" - --static gchar * --_tracker_utils_format_into_graph (const gchar *graph) --{ -- return (graph != NULL) ? g_strdup_printf ("INTO <%s> ", graph) : g_strdup (""); --} -- - static gboolean - gom_tracker_sparql_connection_get_string_attribute (TrackerSparqlConnection *connection, - GCancellable *cancellable, - GError **error, -+ const gchar *graph, - const gchar *resource, - const gchar *attribute, - gchar **value) -@@ -45,8 +40,8 @@ gom_tracker_sparql_connection_get_string_attribute (TrackerSparqlConnection *con - const gchar *string_value = NULL; - gboolean res; - -- g_string_append_printf (select, "SELECT ?val { <%s> %s ?val }", -- resource, attribute); -+ g_string_append_printf (select, "SELECT ?val { GRAPH <%s> { <%s> %s ?val } }", -+ graph, resource, attribute); - cursor = tracker_sparql_connection_query (connection, - select->str, - cancellable, error); -@@ -86,7 +81,8 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti - const gchar *class, - ...) - { -- GString *select, *insert, *inner; -+ GString *select, *inner; -+ gchar *insert; - va_list args; - const gchar *arg; - TrackerSparqlCursor *cursor; -@@ -98,6 +94,8 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti - gchar *key = NULL, *val = NULL; - gboolean exists = FALSE; - -+ g_return_val_if_fail (graph != NULL, NULL); -+ - /* build the inner query with all the classes */ - va_start (args, class); - inner = g_string_new (NULL); -@@ -112,7 +110,7 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti - /* query if such a resource is already in the DB */ - select = g_string_new (NULL); - g_string_append_printf (select, -- "SELECT ?urn WHERE { ?urn %s }", inner->str); -+ "SELECT ?urn WHERE { GRAPH <%s> { ?urn %s } }", graph, inner->str); - - cursor = tracker_sparql_connection_query (connection, - select->str, -@@ -138,19 +136,12 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti - } - - /* not found, create the resource */ -- insert = g_string_new (NULL); -- graph_str = _tracker_utils_format_into_graph (graph); -- -- g_string_append_printf (insert, "INSERT %s { _:res %s }", -- graph_str, inner->str); -- g_free (graph_str); -- g_string_free (inner, TRUE); -- -+ insert = g_strdup_printf ("INSERT INTO <%s> { _:res %s }", -+ graph, inner->str); - insert_res = -- tracker_sparql_connection_update_blank (connection, insert->str, -+ tracker_sparql_connection_update_blank (connection, insert, - G_PRIORITY_DEFAULT, NULL, error); -- -- g_string_free (insert, TRUE); -+ g_free (insert); - - if (*error != NULL) - goto out; -@@ -194,10 +185,10 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection - const gchar *property_value) - { - GString *insert; -- gchar *graph_str, *quoted; -+ gchar *quoted; - gboolean retval = TRUE; - -- graph_str = _tracker_utils_format_into_graph (graph); -+ g_return_val_if_fail (graph != NULL, FALSE); - - /* the "null" value must not be quoted */ - if (property_value == NULL) -@@ -208,8 +199,8 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection - insert = g_string_new (NULL); - g_string_append_printf - (insert, -- "INSERT OR REPLACE %s { <%s> a nie:InformationElement, nie:DataObject ; %s %s }", -- graph_str, resource, property_name, quoted); -+ "INSERT OR REPLACE INTO <%s> { <%s> a nie:InformationElement, nie:DataObject ; %s %s }", -+ graph, resource, property_name, quoted); - g_free (quoted); - - g_debug ("Insert or replace triple: query %s", insert->str); -@@ -223,8 +214,6 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection - if (*error != NULL) - retval = FALSE; - -- g_free (graph_str); -- - return retval; - } - -@@ -271,6 +260,7 @@ gboolean - gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection, - GCancellable *cancellable, - GError **error, -+ const gchar *graph, - const gchar *resource, - gboolean favorite) - { -@@ -279,15 +269,15 @@ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connecti - gboolean retval = TRUE; - - if (favorite) -- op_str = "INSERT OR REPLACE"; -+ op_str = "INSERT OR REPLACE INTO"; - else -- op_str = "DELETE"; -+ op_str = "DELETE FROM"; - - update = g_string_new (NULL); - g_string_append_printf - (update, -- "%s { <%s> nao:hasTag nao:predefined-tag-favorite }", -- op_str, resource); -+ "%s <%s> { <%s> nao:hasTag nao:predefined-tag-favorite }", -+ op_str, graph, resource); - - g_debug ("Toggle favorite: query %s", update->str); - -@@ -321,9 +311,13 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection, - mail_uri = g_strconcat ("mailto:", email, NULL); - select = g_string_new (NULL); - g_string_append_printf (select, -- "SELECT ?urn WHERE { ?urn a nco:Contact . " -- "?urn nco:hasEmailAddress ?mail . " -- "FILTER (fn:contains(?mail, \"%s\" )) }", mail_uri); -+ "SELECT ?urn WHERE { " -+ " GRAPH <%s> { " -+ " ?urn a nco:Contact . " -+ " ?urn nco:hasEmailAddress ?mail . " -+ " FILTER (fn:contains(?mail, \"%s\" )) " -+ " }" -+ "}", TRACKER_CONTACTS_GRAPH, mail_uri); - - cursor = tracker_sparql_connection_query (connection, - select->str, -@@ -351,8 +345,9 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection, - insert = g_string_new (NULL); - - g_string_append_printf (insert, -- "INSERT { <%s> a nco:EmailAddress ; nco:emailAddress \"%s\" . " -+ "INSERT INTO <%s> { <%s> a nco:EmailAddress ; nco:emailAddress \"%s\" . " - "_:res a nco:Contact ; nco:hasEmailAddress <%s> ; nco:fullname \"%s\" . }", -+ TRACKER_CONTACTS_GRAPH, - mail_uri, email, - mail_uri, fullname); - -@@ -397,6 +392,7 @@ gchar * - gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection, - GCancellable *cancellable, - GError **error, -+ const gchar *graph, - const gchar *make, - const gchar *model) - { -@@ -416,7 +412,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection - equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:", - make != NULL ? make : "", - model != NULL ? model : ""); -- select = g_strdup_printf ("SELECT <%s> WHERE { }", equip_uri); -+ select = g_strdup_printf ("ASK { GRAPH <%s> { <%s> a nfo:Equipment } }", graph, equip_uri); - - local_error = NULL; - cursor = tracker_sparql_connection_query (connection, select, cancellable, &local_error); -@@ -436,20 +432,19 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection - - if (res) - { -- const gchar *cursor_uri; -- -- cursor_uri = tracker_sparql_cursor_get_string (cursor, 0, NULL); -- if (g_strcmp0 (cursor_uri, equip_uri) == 0) -+ if (tracker_sparql_cursor_get_boolean (cursor, 0)) - { -- /* return the found resource */ -- retval = g_strdup (cursor_uri); -+ /* The resource exists */ -+ retval = equip_uri; -+ equip_uri = NULL; - g_debug ("Found resource in the store: %s", retval); - goto out; - } - } - - /* not found, create the resource */ -- insert = g_strdup_printf ("INSERT { <%s> a nfo:Equipment ; nfo:manufacturer \"%s\" ; nfo:model \"%s\" }", -+ insert = g_strdup_printf ("INSERT INTO <%s> { <%s> a nfo:Equipment ; nfo:manufacturer \"%s\" ; nfo:model \"%s\" }", -+ graph, - equip_uri, - make, - model); -@@ -480,7 +475,7 @@ void - gom_tracker_update_datasource (TrackerSparqlConnection *connection, - const gchar *datasource_urn, - gboolean resource_exists, -- const gchar *identifier, -+ const gchar *graph, - const gchar *resource, - GCancellable *cancellable, - GError **error) -@@ -498,7 +493,7 @@ gom_tracker_update_datasource (TrackerSparqlConnection *connection, - - res = gom_tracker_sparql_connection_get_string_attribute - (connection, cancellable, error, -- resource, "nie:dataSource", &old_value); -+ graph, resource, "nie:dataSource", &old_value); - g_clear_error (error); - - if (res) -@@ -514,7 +509,7 @@ gom_tracker_update_datasource (TrackerSparqlConnection *connection, - if (set_datasource) - gom_tracker_sparql_connection_set_triple - (connection, cancellable, error, -- identifier, resource, -+ graph, resource, - "nie:dataSource", datasource_urn); - } - -@@ -522,7 +517,7 @@ gboolean - gom_tracker_update_mtime (TrackerSparqlConnection *connection, - gint64 new_mtime, - gboolean resource_exists, -- const gchar *identifier, -+ const gchar *graph, - const gchar *resource, - GCancellable *cancellable, - GError **error) -@@ -536,7 +531,7 @@ gom_tracker_update_mtime (TrackerSparqlConnection *connection, - { - res = gom_tracker_sparql_connection_get_string_attribute - (connection, cancellable, error, -- resource, "nie:contentLastModified", &old_value); -+ graph, resource, "nie:contentLastModified", &old_value); - g_clear_error (error); - - if (res) -@@ -552,7 +547,7 @@ gom_tracker_update_mtime (TrackerSparqlConnection *connection, - date = gom_iso8601_from_timestamp (new_mtime); - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, cancellable, error, -- identifier, resource, -+ graph, resource, - "nie:contentLastModified", date); - g_free (date); - -diff --git a/src/gom-tracker.h b/src/gom-tracker.h -index 94a39e8..a5ae6fd 100644 ---- a/src/gom-tracker.h -+++ b/src/gom-tracker.h -@@ -29,6 +29,14 @@ - - G_BEGIN_DECLS - -+/* The graph where we store account meta information */ -+#define GOM_GRAPH "tracker.api.gnome.org/ontology/v3/gnome-online-miners" -+ -+/* Graphs where we store content information */ -+#define TRACKER_CONTACTS_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Contacts" -+#define TRACKER_DOCUMENTS_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Documents" -+#define TRACKER_PICTURES_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Pictures" -+ - gchar *gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connection, - GCancellable *cancellable, - GError **error, -@@ -57,6 +65,7 @@ gboolean gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *conn - gboolean gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection, - GCancellable *cancellable, - GError **error, -+ const gchar *graph, - const gchar *resource, - gboolean favorite); - -@@ -69,20 +78,21 @@ gchar* gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *conne - gchar *gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection, - GCancellable *cancellable, - GError **error, -+ const gchar *graph, - const gchar *make, - const gchar *model); - - void gom_tracker_update_datasource (TrackerSparqlConnection *connection, - const gchar *datasource_urn, - gboolean resource_exists, -- const gchar *identifier, -+ const gchar *graph, - const gchar *resource, - GCancellable *cancellable, - GError **error); - gboolean gom_tracker_update_mtime (TrackerSparqlConnection *connection, - gint64 new_mtime, - gboolean resource_exists, -- const gchar *identifier, -+ const gchar *graph, - const gchar *resource, - GCancellable *cancellable, - GError **error); -diff --git a/src/gom-zpj-miner.c b/src/gom-zpj-miner.c -index 6dff947..1372de5 100644 ---- a/src/gom-zpj-miner.c -+++ b/src/gom-zpj-miner.c -@@ -70,14 +70,14 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - (connection, - cancellable, error, - &resource_exists, -- datasource_urn, identifier, -+ TRACKER_PICTURES_GRAPH, identifier, - "nfo:RemoteDataObject", class, NULL); - - if (*error != NULL) - goto out; - - gom_tracker_update_datasource (connection, datasource_urn, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -86,7 +86,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - updated_time = zpj_skydrive_entry_get_updated_time (entry); - new_mtime = g_date_time_to_unix (updated_time); - mtime_changed = gom_tracker_update_mtime (connection, new_mtime, -- resource_exists, identifier, resource, -+ resource_exists, TRACKER_PICTURES_GRAPH, resource, - cancellable, error); - - if (*error != NULL) -@@ -102,7 +102,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:url", identifier); - - if (*error != NULL) -@@ -119,7 +119,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - parent_resource_urn = gom_tracker_sparql_connection_ensure_resource - (connection, cancellable, error, - NULL, -- datasource_urn, parent_identifier, -+ TRACKER_PICTURES_GRAPH, parent_identifier, - "nfo:RemoteDataObject", "nfo:DataContainer", NULL); - g_free (parent_identifier); - -@@ -129,7 +129,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:isPartOf", parent_resource_urn); - g_free (parent_resource_urn); - -@@ -142,7 +142,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:mimeType", mime); - g_free (mime); - -@@ -154,7 +154,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:description", zpj_skydrive_entry_get_description (entry)); - - if (*error != NULL) -@@ -163,7 +163,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nfo:fileName", name); - - if (*error != NULL) -@@ -180,7 +180,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nco:creator", contact_resource); - g_free (contact_resource); - -@@ -192,7 +192,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job, - gom_tracker_sparql_connection_insert_or_replace_triple - (connection, - cancellable, error, -- datasource_urn, resource, -+ TRACKER_PICTURES_GRAPH, resource, - "nie:contentCreated", date); - g_free (date); - --- -GitLab - - -From 34259944dd9e6e167663c97080142f6e8b7f00f2 Mon Sep 17 00:00:00 2001 -From: Sam Thursfield -Date: Mon, 27 Jul 2020 23:48:49 +0200 -Subject: [PATCH 5/5] Update for API changes in Tracker 2.99 - ---- - src/gom-miner.c | 3 --- - src/gom-tracker.c | 22 ++++++---------------- - 2 files changed, 6 insertions(+), 19 deletions(-) - -diff --git a/src/gom-miner.c b/src/gom-miner.c -index 32892fa..d9ccf67 100644 ---- a/src/gom-miner.c -+++ b/src/gom-miner.c -@@ -382,7 +382,6 @@ gom_miner_ensure_datasource (GomMiner *self, - - tracker_sparql_connection_update (self->priv->connection, - datasource_insert->str, -- G_PRIORITY_DEFAULT, - cancellable, - error); - -@@ -469,7 +468,6 @@ gom_account_miner_job_cleanup_previous (GomAccountMinerJob *job, - - tracker_sparql_connection_update (job->connection, - delete->str, -- G_PRIORITY_DEFAULT, - cancellable, - error); - -@@ -709,7 +707,6 @@ cleanup_job_do_cleanup (CleanupJob *job, GCancellable *cancellable) - - tracker_sparql_connection_update (self->priv->connection, - update->str, -- G_PRIORITY_DEFAULT, - cancellable, - &error); - g_string_free (update, TRUE); -diff --git a/src/gom-tracker.c b/src/gom-tracker.c -index 0d1766c..5f49f73 100644 ---- a/src/gom-tracker.c -+++ b/src/gom-tracker.c -@@ -138,9 +138,7 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti - /* not found, create the resource */ - insert = g_strdup_printf ("INSERT INTO <%s> { _:res %s }", - graph, inner->str); -- insert_res = -- tracker_sparql_connection_update_blank (connection, insert, -- G_PRIORITY_DEFAULT, NULL, error); -+ insert_res = tracker_sparql_connection_update_blank (connection, insert, NULL, error); - g_free (insert); - - if (*error != NULL) -@@ -205,9 +203,7 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection - - g_debug ("Insert or replace triple: query %s", insert->str); - -- tracker_sparql_connection_update (connection, insert->str, -- G_PRIORITY_DEFAULT, cancellable, -- error); -+ tracker_sparql_connection_update (connection, insert->str, cancellable, error); - - g_string_free (insert, TRUE); - -@@ -235,9 +231,7 @@ gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *connection, - "DELETE { <%s> %s ?val } WHERE { <%s> %s ?val }", resource, - property_name, resource, property_name); - -- tracker_sparql_connection_update (connection, delete->str, -- G_PRIORITY_DEFAULT, cancellable, -- error); -+ tracker_sparql_connection_update (connection, delete->str, cancellable, error); - - g_string_free (delete, TRUE); - if (*error != NULL) -@@ -281,9 +275,7 @@ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connecti - - g_debug ("Toggle favorite: query %s", update->str); - -- tracker_sparql_connection_update (connection, update->str, -- G_PRIORITY_DEFAULT, cancellable, -- error); -+ tracker_sparql_connection_update (connection, update->str, cancellable, error); - - g_string_free (update, TRUE); - -@@ -351,9 +343,7 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection, - mail_uri, email, - mail_uri, fullname); - -- insert_res = -- tracker_sparql_connection_update_blank (connection, insert->str, -- G_PRIORITY_DEFAULT, cancellable, error); -+ insert_res = tracker_sparql_connection_update_blank (connection, insert->str, cancellable, error); - - g_string_free (insert, TRUE); - -@@ -450,7 +440,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection - model); - - local_error = NULL; -- tracker_sparql_connection_update (connection, insert, G_PRIORITY_DEFAULT, cancellable, &local_error); -+ tracker_sparql_connection_update (connection, insert, cancellable, &local_error); - if (local_error != NULL) - { - g_propagate_error (error, local_error); --- -GitLab -