Update to meta-tracker-2.1.7.

This commit is contained in:
ajacoutot 2019-02-08 10:57:22 +00:00
parent 14eec74b8c
commit 850483bef6
9 changed files with 7 additions and 383 deletions

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.236 2019/01/04 08:56:44 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.237 2019/02/08 10:57:22 ajacoutot Exp $
COMMENT= metadata database and search tool
GNOME_PROJECT= tracker
GNOME_VERSION= 2.1.6
REVISION= 0
GNOME_VERSION= 2.1.7
# there is already audio/tracker, so this port has to live
# as meta-tracker
@ -21,9 +20,9 @@ SUBST_VARS= TRACKER_API
SHARED_LIBS += tracker-common 4.0 # unknown
SHARED_LIBS += tracker-data 4.0 # unknown
SHARED_LIBS += tracker-sparql-2.0 0.0 # 106.0
SHARED_LIBS += tracker-miner-2.0 0.0 # 106.0
SHARED_LIBS += tracker-control-2.0 0.0 # 106.0
SHARED_LIBS += tracker-sparql-2.0 0.0 # 107.0
SHARED_LIBS += tracker-miner-2.0 0.0 # 107.0
SHARED_LIBS += tracker-control-2.0 0.0 # 107.0
# GPLv2+ - LGPLv2.1+
PERMIT_PACKAGE_CDROM= Yes

View File

@ -1,2 +1,2 @@
SHA256 (gnome/tracker-2.1.6.tar.xz) = mCvQq+YqKn5yx/fvt5Nd0z4YYCZePHzrkO9RUPBVf5A=
SIZE (gnome/tracker-2.1.6.tar.xz) = 2580432
SHA256 (gnome/tracker-2.1.7.tar.xz) = +057cZKdvFYEW8WSC9Dke2CBoJTBMemR5aQR5Eskoko=
SIZE (gnome/tracker-2.1.7.tar.xz) = 2572740

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_libtracker-data_meson_build,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From 3cbfaa5b374e615098e60eb4430f108b642ebe76 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 6 Nov 2018 11:36:52 +0100
Subject: [PATCH] build: Fix build order with libtracker-sparql generated headers
Index: src/libtracker-data/meson.build
--- src/libtracker-data/meson.build.orig
+++ src/libtracker-data/meson.build
@@ -73,7 +73,7 @@ libtracker_data = library('tracker-data',
# symbols from libtracker-sparql, but does not mean it should
# be linked to it.
override_options: ['b_lundef=false'],
- dependencies: tracker_data_dependencies + [unicode_library],
+ dependencies: tracker_data_dependencies + [unicode_library, tracker_sparql_intermediate_dep],
include_directories: [commoninc, configinc, srcinc],
)

View File

@ -1,218 +0,0 @@
$OpenBSD: patch-src_libtracker-data_tracker-data-manager_c,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From fedb4d58557a5d34ab3fdd7869a05bd87aff7193 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 8 Nov 2018 12:40:36 +0100
Subject: [PATCH] libtracker-data: Drop FTS table/view before ontology updates
Index: src/libtracker-data/tracker-data-manager.c
--- src/libtracker-data/tracker-data-manager.c.orig
+++ src/libtracker-data/tracker-data-manager.c
@@ -135,6 +135,12 @@ enum {
N_PROPS
};
+#if HAVE_TRACKER_FTS
+static gboolean tracker_data_manager_fts_changed (TrackerDataManager *manager);
+static void tracker_data_manager_update_fts (TrackerDataManager *manager,
+ TrackerDBInterface *iface);
+#endif
+
static void tracker_data_manager_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (TrackerDataManager, tracker_data_manager, G_TYPE_OBJECT,
@@ -3681,6 +3687,9 @@ tracker_data_ontology_import_into_db (TrackerDataManag
TrackerProperty **properties;
guint i, n_props, n_classes;
gboolean base_tables_altered = FALSE;
+#if HAVE_TRACKER_FTS
+ gboolean update_fts = FALSE;
+#endif
iface = tracker_db_manager_get_writable_db_interface (manager->db_manager);
@@ -3691,6 +3700,15 @@ tracker_data_ontology_import_into_db (TrackerDataManag
return;
}
+#if HAVE_TRACKER_FTS
+ if (in_update) {
+ update_fts = tracker_data_manager_fts_changed (manager);
+
+ if (update_fts)
+ tracker_db_interface_sqlite_fts_delete_table (iface);
+ }
+#endif
+
/* create tables */
for (i = 0; i < n_classes; i++) {
GError *internal_error = NULL;
@@ -3740,6 +3758,14 @@ tracker_data_ontology_import_into_db (TrackerDataManag
}
}
}
+
+#if HAVE_TRACKER_FTS
+ if (update_fts) {
+ tracker_data_manager_update_fts (manager, iface);
+ } else {
+ tracker_data_manager_init_fts (iface, !in_update);
+ }
+#endif
}
static gint
@@ -3942,13 +3968,44 @@ load_ontologies_gvdb (TrackerDataManager *manager,
#if HAVE_TRACKER_FTS
static gboolean
+tracker_data_manager_fts_changed (TrackerDataManager *manager)
+{
+ TrackerProperty **properties;
+ gboolean has_changed = FALSE;
+ guint i, len;
+
+ properties = tracker_ontologies_get_properties (manager->ontologies, &len);
+
+ for (i = 0; i < len; i++) {
+ TrackerClass *class;
+
+ if (tracker_property_get_fulltext_indexed (properties[i]) !=
+ tracker_property_get_orig_fulltext_indexed (properties[i])) {
+ has_changed |= TRUE;
+ }
+
+ if (!tracker_property_get_fulltext_indexed (properties[i])) {
+ continue;
+ }
+
+ has_changed |= tracker_property_get_is_new (properties[i]);
+
+ /* We must also regenerate FTS if any table in the view
+ * updated its schema.
+ */
+ class = tracker_property_get_domain (properties[i]);
+ has_changed |= tracker_class_get_db_schema_changed (class);
+ }
+
+ return has_changed;
+}
+
+static void
ontology_get_fts_properties (TrackerDataManager *manager,
- gboolean only_new,
GHashTable **fts_properties,
GHashTable **multivalued)
{
TrackerProperty **properties;
- gboolean has_changed = FALSE;
guint i, len;
properties = tracker_ontologies_get_properties (manager->ontologies, &len);
@@ -3960,16 +4017,10 @@ ontology_get_fts_properties (TrackerDataManager *mana
const gchar *name, *table_name;
GList *list;
- if (tracker_property_get_fulltext_indexed (properties[i]) !=
- tracker_property_get_orig_fulltext_indexed (properties[i])) {
- has_changed |= TRUE;
- }
-
if (!tracker_property_get_fulltext_indexed (properties[i])) {
continue;
}
- has_changed |= tracker_property_get_is_new (properties[i]);
table_name = tracker_property_get_table_name (properties[i]);
name = tracker_property_get_name (properties[i]);
list = g_hash_table_lookup (*fts_properties, table_name);
@@ -3986,8 +4037,6 @@ ontology_get_fts_properties (TrackerDataManager *mana
list = g_list_append (list, (gpointer) name);
}
}
-
- return has_changed;
}
static void
@@ -4001,29 +4050,36 @@ rebuild_fts_tokens (TrackerDataManager *manager,
/* Update the stamp file */
tracker_db_manager_tokenizer_update (manager->db_manager);
}
-#endif
gboolean
tracker_data_manager_init_fts (TrackerDBInterface *iface,
gboolean create)
{
-#if HAVE_TRACKER_FTS
GHashTable *fts_props, *multivalued;
TrackerDataManager *manager;
manager = tracker_db_interface_get_user_data (iface);
- ontology_get_fts_properties (manager, FALSE, &fts_props, &multivalued);
+ ontology_get_fts_properties (manager, &fts_props, &multivalued);
tracker_db_interface_sqlite_fts_init (iface, fts_props,
multivalued, create);
g_hash_table_unref (fts_props);
g_hash_table_unref (multivalued);
return TRUE;
-#else
- g_info ("FTS support is disabled");
- return FALSE;
-#endif
}
+static void
+tracker_data_manager_update_fts (TrackerDataManager *manager,
+ TrackerDBInterface *iface)
+{
+ GHashTable *fts_properties, *multivalued;
+
+ ontology_get_fts_properties (manager, &fts_properties, &multivalued);
+ tracker_db_interface_sqlite_fts_alter_table (iface, fts_properties, multivalued);
+ g_hash_table_unref (fts_properties);
+ g_hash_table_unref (multivalued);
+}
+#endif
+
GFile *
tracker_data_manager_get_cache_location (TrackerDataManager *manager)
{
@@ -4279,8 +4335,6 @@ tracker_data_manager_initable_init (GInitable *ini
tracker_data_ontology_import_into_db (manager, FALSE,
&internal_error);
- tracker_data_manager_init_fts (iface, TRUE);
-
if (internal_error) {
g_propagate_error (error, internal_error);
return FALSE;
@@ -4371,7 +4425,9 @@ tracker_data_manager_initable_init (GInitable *ini
}
}
+#if HAVE_TRACKER_FTS
tracker_data_manager_init_fts (iface, FALSE);
+#endif
}
if (!read_only) {
@@ -4630,17 +4686,6 @@ tracker_data_manager_initable_init (GInitable *ini
}
if (update_nao) {
-#if HAVE_TRACKER_FTS
- GHashTable *fts_properties, *multivalued;
-
- if (ontology_get_fts_properties (manager, TRUE, &fts_properties, &multivalued)) {
- tracker_db_interface_sqlite_fts_alter_table (iface, fts_properties, multivalued);
- }
-
- g_hash_table_unref (fts_properties);
- g_hash_table_unref (multivalued);
-#endif
-
update_ontology_last_modified (manager, iface, ontology, &n_error);
if (n_error) {

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-src_libtracker-data_tracker-db-interface-sqlite_c,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From fedb4d58557a5d34ab3fdd7869a05bd87aff7193 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 8 Nov 2018 12:40:36 +0100
Subject: [PATCH] libtracker-data: Drop FTS table/view before ontology updates
Index: src/libtracker-data/tracker-db-interface-sqlite.c
--- src/libtracker-data/tracker-db-interface-sqlite.c.orig
+++ src/libtracker-data/tracker-db-interface-sqlite.c
@@ -1648,6 +1648,14 @@ tracker_db_interface_sqlite_fts_init (TrackerDBInterfa
#if HAVE_TRACKER_FTS
void
+tracker_db_interface_sqlite_fts_delete_table (TrackerDBInterface *db_interface)
+{
+ if (!tracker_fts_delete_table (db_interface->db, "fts5")) {
+ g_critical ("Failed to delete FTS table");
+ }
+}
+
+void
tracker_db_interface_sqlite_fts_alter_table (TrackerDBInterface *db_interface,
GHashTable *properties,
GHashTable *multivalued)

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_libtracker-data_tracker-db-interface-sqlite_h,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From fedb4d58557a5d34ab3fdd7869a05bd87aff7193 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 8 Nov 2018 12:40:36 +0100
Subject: [PATCH] libtracker-data: Drop FTS table/view before ontology updates
Index: src/libtracker-data/tracker-db-interface-sqlite.h
--- src/libtracker-data/tracker-db-interface-sqlite.h.orig
+++ src/libtracker-data/tracker-db-interface-sqlite.h
@@ -59,6 +59,8 @@ gboolean tracker_db_interface_sqlite_wal_ch
#if HAVE_TRACKER_FTS
+void tracker_db_interface_sqlite_fts_delete_table (TrackerDBInterface *interface);
+
void tracker_db_interface_sqlite_fts_alter_table (TrackerDBInterface *interface,
GHashTable *properties,
GHashTable *multivalued);

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_libtracker-fts_meson_build,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From 3cbfaa5b374e615098e60eb4430f108b642ebe76 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 6 Nov 2018 11:36:52 +0100
Subject: [PATCH] build: Fix build order with libtracker-sparql generated headers
Index: src/libtracker-fts/meson.build
--- src/libtracker-fts/meson.build.orig
+++ src/libtracker-fts/meson.build
@@ -11,7 +11,7 @@ libtracker_fts = static_library('tracker-fts',
'tracker-fts-config.c',
'tracker-fts-tokenizer.c',
libtracker_fts_fts5,
- dependencies: [tracker_common_dep],
+ dependencies: [tracker_common_dep, tracker_sparql_intermediate_dep],
c_args: tracker_c_args
)

View File

@ -1,56 +0,0 @@
$OpenBSD: patch-src_libtracker-fts_tracker-fts_c,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From fedb4d58557a5d34ab3fdd7869a05bd87aff7193 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 8 Nov 2018 12:40:36 +0100
Subject: [PATCH] libtracker-data: Drop FTS table/view before ontology updates
Index: src/libtracker-fts/tracker-fts.c
--- src/libtracker-fts/tracker-fts.c.orig
+++ src/libtracker-fts/tracker-fts.c
@@ -158,6 +158,26 @@ tracker_fts_create_table (sqlite3 *db,
}
gboolean
+tracker_fts_delete_table (sqlite3 *db,
+ gchar *table_name)
+{
+ gchar *query;
+ int rc;
+
+ query = g_strdup_printf ("DROP VIEW fts_view");
+ rc = sqlite3_exec (db, query, NULL, NULL, NULL);
+ g_free (query);
+
+ if (rc == SQLITE_OK) {
+ query = g_strdup_printf ("DROP TABLE %s", table_name);
+ sqlite3_exec (db, query, NULL, NULL, NULL);
+ g_free (query);
+ }
+
+ return rc == SQLITE_OK;
+}
+
+gboolean
tracker_fts_alter_table (sqlite3 *db,
gchar *table_name,
GHashTable *tables,
@@ -167,18 +187,6 @@ tracker_fts_alter_table (sqlite3 *db,
int rc;
tmp_name = g_strdup_printf ("%s_TMP", table_name);
-
- query = g_strdup_printf ("DROP VIEW fts_view");
- rc = sqlite3_exec (db, query, NULL, NULL, NULL);
- g_free (query);
-
- query = g_strdup_printf ("DROP TABLE %s", tmp_name);
- rc = sqlite3_exec (db, query, NULL, NULL, NULL);
- g_free (query);
-
- query = g_strdup_printf ("DROP TABLE %s", table_name);
- rc = sqlite3_exec (db, query, NULL, NULL, NULL);
- g_free (query);
if (!tracker_fts_create_table (db, tmp_name, tables, grouped_columns)) {
g_free (tmp_name);

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_libtracker-fts_tracker-fts_h,v 1.1 2019/01/04 08:56:44 ajacoutot Exp $
From fedb4d58557a5d34ab3fdd7869a05bd87aff7193 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 8 Nov 2018 12:40:36 +0100
Subject: [PATCH] libtracker-data: Drop FTS table/view before ontology updates
Index: src/libtracker-fts/tracker-fts.h
--- src/libtracker-fts/tracker-fts.h.orig
+++ src/libtracker-fts/tracker-fts.h
@@ -36,6 +36,8 @@ gboolean tracker_fts_create_table (sqlite3 *
gchar *table_name,
GHashTable *tables,
GHashTable *grouped_columns);
+gboolean tracker_fts_delete_table (sqlite3 *db,
+ gchar *table_name);
gboolean tracker_fts_alter_table (sqlite3 *db,
gchar *table_name,
GHashTable *tables,