From 47314583713cf1ad5131da4d38fe8e3745a2689fe45c4a9acbc478dd9831882b Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 15 May 2020 09:34:40 +0000 Subject: [PATCH] Accepting request 805596 from GNOME:Next - Add tracker-ontology-upgrades.patch: libtracker-data: Improve changes over single valued ontology properties (boo#1170587). OBS-URL: https://build.opensuse.org/request/show/805596 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/tracker?expand=0&rev=199 --- tracker-ontology-upgrades.patch | 84 +++++++++++++++++++++++++++++++++ tracker.changes | 6 +++ tracker.spec | 3 +- 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tracker-ontology-upgrades.patch diff --git a/tracker-ontology-upgrades.patch b/tracker-ontology-upgrades.patch new file mode 100644 index 0000000..01ac223 --- /dev/null +++ b/tracker-ontology-upgrades.patch @@ -0,0 +1,84 @@ +From e4303edce3c70dcd60300d6b72761cdc8d89121e Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Wed, 13 May 2020 19:41:55 +0200 +Subject: [PATCH] libtracker-data: Improve changes over single valued ontology + properties + +Things like rdfs:label and rdfs:comment that are not tracker through the +TrackerOntology and are single-valued may result in errors if there's +changes on those. + +Handle those better by replacing the value instead of trying to insert +over it. +--- + src/libtracker-data/tracker-data-manager.c | 43 +++++++++++++--------- + 1 file changed, 26 insertions(+), 17 deletions(-) + +diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c +index dadb0f585..22f8749fc 100644 +--- a/src/libtracker-data/tracker-data-manager.c ++++ b/src/libtracker-data/tracker-data-manager.c +@@ -1962,6 +1962,7 @@ tracker_data_ontology_process_statement (TrackerDataManager *manager, + gboolean in_update, + gboolean ignore_nao_last_modified) + { ++ TrackerProperty *property; + GError *error = NULL; + + if (g_strcmp0 (predicate, RDF_TYPE) == 0) { +@@ -2042,28 +2043,36 @@ tracker_data_ontology_process_statement (TrackerDataManager *manager, + } + } + +- if (is_uri) { +- tracker_data_insert_statement_with_uri (manager->data_update, graph, subject, +- predicate, object, +- &error); ++ property = tracker_ontologies_get_property_by_uri (manager->ontologies, predicate); + +- if (error != NULL) { +- g_critical ("%s", error->message); +- g_error_free (error); +- return; ++ if (is_uri) { ++ if (tracker_property_get_is_new (property) || ++ tracker_property_get_multiple_values (property)) { ++ tracker_data_insert_statement_with_uri (manager->data_update, NULL, ++ subject, predicate, object, ++ &error); ++ } else { ++ tracker_data_update_statement (manager->data_update, NULL, ++ subject, predicate, object, ++ &error); + } +- + } else { +- tracker_data_insert_statement_with_string (manager->data_update, graph, subject, +- predicate, object, +- &error); +- +- if (error != NULL) { +- g_critical ("%s", error->message); +- g_error_free (error); +- return; ++ if (tracker_property_get_is_new (property) || ++ tracker_property_get_multiple_values (property)) { ++ tracker_data_insert_statement_with_string (manager->data_update, NULL, ++ subject, predicate, object, ++ &error); ++ } else { ++ tracker_data_update_statement (manager->data_update, NULL, ++ subject, predicate, object, ++ &error); + } + } ++ ++ if (error != NULL) { ++ g_critical ("%s", error->message); ++ g_error_free (error); ++ } + } + + static void +-- +2.26.2 diff --git a/tracker.changes b/tracker.changes index 3d2b4e2..8f60672 100644 --- a/tracker.changes +++ b/tracker.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 14 12:41:32 UTC 2020 - Dominique Leuenberger + +- Add tracker-ontology-upgrades.patch: libtracker-data: Improve + changes over single valued ontology properties (boo#1170587). + ------------------------------------------------------------------- Thu Apr 16 20:05:07 UTC 2020 - Bjørn Lie diff --git a/tracker.spec b/tracker.spec index 73101ba..b630ae3 100644 --- a/tracker.spec +++ b/tracker.spec @@ -30,7 +30,8 @@ URL: https://wiki.gnome.org/Projects/Tracker Source0: https://download.gnome.org/sources/tracker/2.3/%{name}-%{version}.tar.xz # PATCH-FIX-UPSTREAM tracker-Use-correct-signature.patch -- tracker-store: Use correct signature for DBusSignalCallback Patch0: tracker-Use-correct-signature.patch - +# PATCH-FIX-UPSTREAM tracker-ontology-upgrades.patch boo#1170587 dimstar@opensuse.org -- Fix ontology migration from very old tracker versions +Patch1: tracker-ontology-upgrades.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: glib2-devel >= 2.46.0