Update to 0.17.1
This commit is contained in:
parent
80dfcaa071
commit
96c44221d4
@ -1,136 +0,0 @@
|
||||
From 00b71d0f9ae3f4d2b7bc8fa2afe08cd89c5c9c35 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
Date: Tue, 3 Dec 2013 16:17:54 +0100
|
||||
Subject: [PATCH] fts: Strengthen against sqlite failures in FTS functions
|
||||
|
||||
function_weights() and function_property_names() (used respectively by
|
||||
SPARQL fts:rank and fts:offsets functions), initialize all data at first
|
||||
from the database, so it's available in memory for posterior runs,
|
||||
although currently those are being quite optimistic about the database
|
||||
return values in several ways, so:
|
||||
|
||||
- Ensure no infinite loops happen on sqlite3_step() if the stmt trips
|
||||
into some unexpected state. SQLITE_BUSY still does keep looping though.
|
||||
|
||||
- As initialization here is a failable task, stop using g_once_init_*
|
||||
and use an static GMutex so initialization can be tried later again
|
||||
if it failed previously.
|
||||
|
||||
- For the cases where initialization failed, propagate the error code
|
||||
on the sqlite3_context.
|
||||
|
||||
Based on work by Tim Waugh and Michael Catanzaro.
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1026283
|
||||
---
|
||||
src/libtracker-fts/tracker-fts.c | 52 +++++++++++++++++++++++++++-------------
|
||||
1 file changed, 36 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
|
||||
index 530d831..446a4a6 100644
|
||||
--- a/src/libtracker-fts/tracker-fts.c
|
||||
+++ b/src/libtracker-fts/tracker-fts.c
|
||||
@@ -127,13 +127,15 @@ function_weights (sqlite3_context *context,
|
||||
sqlite3_value *argv[])
|
||||
{
|
||||
static guint *weights = NULL;
|
||||
- static gsize weights_initialized = 0;
|
||||
+ static GMutex mutex;
|
||||
+ int rc = SQLITE_DONE;
|
||||
|
||||
- if (g_once_init_enter (&weights_initialized)) {
|
||||
+ g_mutex_lock (&mutex);
|
||||
+
|
||||
+ if (G_UNLIKELY (weights == NULL)) {
|
||||
GArray *weight_array;
|
||||
sqlite3_stmt *stmt;
|
||||
sqlite3 *db;
|
||||
- int rc;
|
||||
|
||||
weight_array = g_array_new (FALSE, FALSE, sizeof (guint));
|
||||
db = sqlite3_context_db_handle (context);
|
||||
@@ -149,18 +151,26 @@ function_weights (sqlite3_context *context,
|
||||
guint weight;
|
||||
weight = sqlite3_column_int (stmt, 0);
|
||||
g_array_append_val (weight_array, weight);
|
||||
+ } else if (rc != SQLITE_BUSY) {
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
+ sqlite3_finalize (stmt);
|
||||
+
|
||||
if (rc == SQLITE_DONE) {
|
||||
- rc = sqlite3_finalize (stmt);
|
||||
+ weights = (guint *) g_array_free (weight_array, FALSE);
|
||||
+ } else {
|
||||
+ g_array_free (weight_array, TRUE);
|
||||
}
|
||||
-
|
||||
- weights = (guint *) g_array_free (weight_array, FALSE);
|
||||
- g_once_init_leave (&weights_initialized, (rc == SQLITE_OK));
|
||||
}
|
||||
|
||||
- sqlite3_result_blob (context, weights, sizeof (weights), NULL);
|
||||
+ g_mutex_unlock (&mutex);
|
||||
+
|
||||
+ if (rc == SQLITE_DONE)
|
||||
+ sqlite3_result_blob (context, weights, sizeof (weights), NULL);
|
||||
+ else
|
||||
+ sqlite3_result_error_code (context, rc);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -169,13 +179,15 @@ function_property_names (sqlite3_context *context,
|
||||
sqlite3_value *argv[])
|
||||
{
|
||||
static gchar **names = NULL;
|
||||
- static gsize names_initialized = 0;
|
||||
+ static GMutex mutex;
|
||||
+ int rc = SQLITE_DONE;
|
||||
|
||||
- if (g_once_init_enter (&names_initialized)) {
|
||||
+ g_mutex_lock (&mutex);
|
||||
+
|
||||
+ if (G_UNLIKELY (names == NULL)) {
|
||||
GPtrArray *names_array;
|
||||
sqlite3_stmt *stmt;
|
||||
sqlite3 *db;
|
||||
- int rc;
|
||||
|
||||
names_array = g_ptr_array_new ();
|
||||
db = sqlite3_context_db_handle (context);
|
||||
@@ -194,18 +206,26 @@ function_property_names (sqlite3_context *context,
|
||||
|
||||
name = sqlite3_column_text (stmt, 0);
|
||||
g_ptr_array_add (names_array, g_strdup (name));
|
||||
+ } else if (rc != SQLITE_BUSY) {
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
+ sqlite3_finalize (stmt);
|
||||
+
|
||||
if (rc == SQLITE_DONE) {
|
||||
- rc = sqlite3_finalize (stmt);
|
||||
+ names = (gchar **) g_ptr_array_free (names_array, FALSE);
|
||||
+ } else {
|
||||
+ g_ptr_array_free (names_array, TRUE);
|
||||
}
|
||||
-
|
||||
- names = (gchar **) g_ptr_array_free (names_array, FALSE);
|
||||
- g_once_init_leave (&names_initialized, (rc == SQLITE_OK));
|
||||
}
|
||||
|
||||
- sqlite3_result_blob (context, names, sizeof (names), NULL);
|
||||
+ g_mutex_unlock (&mutex);
|
||||
+
|
||||
+ if (rc == SQLITE_DONE)
|
||||
+ sqlite3_result_blob (context, names, sizeof (names), NULL);
|
||||
+ else
|
||||
+ sqlite3_result_error_code (context, rc);
|
||||
}
|
||||
|
||||
static void
|
||||
--
|
||||
1.8.4.2
|
||||
|
@ -1,52 +0,0 @@
|
||||
From 436b252fefd026d58e1161bcb733c8deb26dc8ba Mon Sep 17 00:00:00 2001
|
||||
From: Debarshi Ray <debarshir@gnome.org>
|
||||
Date: Wed, 18 Dec 2013 16:39:41 +0100
|
||||
Subject: [PATCH] libtracker-extract: Link against libicu when using it
|
||||
|
||||
---
|
||||
src/libtracker-extract/Makefile.am | 16 ++++++++++------
|
||||
1 file changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libtracker-extract/Makefile.am b/src/libtracker-extract/Makefile.am
|
||||
index 4c59921..b7f0df9 100644
|
||||
--- a/src/libtracker-extract/Makefile.am
|
||||
+++ b/src/libtracker-extract/Makefile.am
|
||||
@@ -11,6 +11,12 @@ AM_CPPFLAGS = \
|
||||
|
||||
lib_LTLIBRARIES = libtracker-extract-@TRACKER_API_VERSION@.la
|
||||
|
||||
+libtracker_extract_@TRACKER_API_VERSION@_la_LIBADD = \
|
||||
+ $(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-@TRACKER_API_VERSION@.la \
|
||||
+ $(top_builddir)/src/libtracker-common/libtracker-common.la \
|
||||
+ $(BUILD_LIBS) \
|
||||
+ $(LIBTRACKER_EXTRACT_LIBS)
|
||||
+
|
||||
libtracker_extractincludedir=$(includedir)/tracker-$(TRACKER_API_VERSION)/libtracker-extract/
|
||||
|
||||
libtracker_extract_@TRACKER_API_VERSION@_la_SOURCES = \
|
||||
@@ -63,18 +69,16 @@ if HAVE_LIBICU
|
||||
libtracker_extract_@TRACKER_API_VERSION@_la_SOURCES += \
|
||||
tracker-encoding-libicu.c \
|
||||
tracker-encoding-libicu.h
|
||||
+AM_CPPFLAGS += \
|
||||
+ $(LIBICU_CFLAGS)
|
||||
+libtracker_extract_@TRACKER_API_VERSION@_la_LIBADD += \
|
||||
+ $(LIBICU_LIBS)
|
||||
endif
|
||||
|
||||
libtracker_extract_@TRACKER_API_VERSION@_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-export-symbols-regex '^tracker_.*'
|
||||
|
||||
-libtracker_extract_@TRACKER_API_VERSION@_la_LIBADD = \
|
||||
- $(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-@TRACKER_API_VERSION@.la \
|
||||
- $(top_builddir)/src/libtracker-common/libtracker-common.la \
|
||||
- $(BUILD_LIBS) \
|
||||
- $(LIBTRACKER_EXTRACT_LIBS)
|
||||
-
|
||||
# Introspection foo
|
||||
-include $(INTROSPECTION_MAKEFILE)
|
||||
INTROSPECTION_GIRS =
|
||||
--
|
||||
1.8.4.2
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
106d5fa2039861044f0bbb13bed0df02 tracker-0.17.0.tar.xz
|
||||
cf5d039096947f3170d5f0abb0e9afb6 tracker-0.17.1.tar.xz
|
||||
|
16
tracker.spec
16
tracker.spec
@ -14,7 +14,7 @@
|
||||
|
||||
Summary: Desktop-neutral search tool and indexer
|
||||
Name: tracker
|
||||
Version: 0.17.0
|
||||
Version: 0.17.1
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
@ -25,16 +25,9 @@ Source0: http://download.gnome.org/sources/tracker/0.17/%{name}-%{version}.tar.x
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=771601
|
||||
Patch1: tracker-0.15-onlyshowin.patch
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1026283
|
||||
Patch2: 0001-fts-Strengthen-against-sqlite-failures-in-FTS-functi.patch
|
||||
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=712142
|
||||
Patch3: 0001-Bump-the-minimum-memory-requirement-to-768M.patch
|
||||
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=720686
|
||||
Patch4: 0001-libtracker-extract-Link-against-libicu-when-using-it.patch
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: poppler-glib-devel libxml2-devel libgsf-devel libgxps-devel
|
||||
BuildRequires: libuuid-devel
|
||||
BuildRequires: nautilus-devel
|
||||
@ -140,16 +133,13 @@ This package contains the documentation for tracker
|
||||
%setup -q
|
||||
|
||||
%patch1 -p1 -b .onlyshowin
|
||||
%patch2 -p1 -b .fts
|
||||
%patch3 -p1 -b .memory
|
||||
%patch4 -p1 -b .build
|
||||
|
||||
## nuke unwanted rpaths, see also
|
||||
## https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath
|
||||
sed -i -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure
|
||||
|
||||
%build
|
||||
autoreconf -f
|
||||
%configure --disable-static \
|
||||
--enable-gtk-doc \
|
||||
--enable-miner-evolution=no \
|
||||
@ -271,6 +261,10 @@ fi
|
||||
%{_datadir}/gtk-doc/html/ontology/
|
||||
|
||||
%changelog
|
||||
* Thu Feb 06 2014 Kalev Lember <kalevlember@gmail.com> - 0.17.1-1
|
||||
- Update to 0.17.1
|
||||
- Drop upstreamed patches
|
||||
|
||||
* Wed Dec 18 2013 Debarshi Ray <rishi@fedoraproject.org> - 0.17.0-1
|
||||
- Update to 0.17.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user