Accepting request 805783 from GNOME:Factory
- Add tracker-ontology-upgrades.patch: libtracker-data: Improve changes over single valued ontology properties (boo#1170587). (forwarded request 805596 from dimstar) OBS-URL: https://build.opensuse.org/request/show/805783 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tracker?expand=0&rev=130
This commit is contained in:
commit
6c365849d8
84
tracker-ontology-upgrades.patch
Normal file
84
tracker-ontology-upgrades.patch
Normal file
@ -0,0 +1,84 @@
|
||||
From e4303edce3c70dcd60300d6b72761cdc8d89121e Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
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
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu May 14 12:41:32 UTC 2020 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
- 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 <bjorn.lie@gmail.com>
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user