From 71fc7142b8fd8ba8d4f56836b37219dbab91d305 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Wed, 24 Feb 2016 14:14:02 +0000 Subject: Imported Debian patch 0.9.16-0ubuntu4 --- debian/changelog | 19 +++ debian/patches/fix-test-crash.patch | 16 +- debian/patches/series | 1 + debian/patches/startup-database-vacuum.patch | 214 +++++++++++++++++++++++++++ debian/zeitgeist-core.install | 1 + 5 files changed, 241 insertions(+), 10 deletions(-) create mode 100644 debian/patches/startup-database-vacuum.patch diff --git a/debian/changelog b/debian/changelog index 3f5d00a..a06add4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +zeitgeist (0.9.16-0ubuntu4) xenial; urgency=medium + + [ Marco Trevisan (Treviño) ] + * debian/patches/startup-database-vacuum.patch: + - Perform VACUUM operation on activity DB on startup (LP: #919801) + + [ Iain Lane ] + * Re-work the above patch to not rely on an upstart job - we don't have + upstart support in D-Bus and it relied on a fair bit of gymnastics that + aren't necessary. + + -- Iain Lane Wed, 24 Feb 2016 14:14:02 +0000 + +zeitgeist (0.9.16-0ubuntu3~gcc5.1) wily; urgency=medium + + * No-change test rebuild for g++5 ABI transition + + -- Steve Langasek Fri, 24 Jul 2015 17:09:20 +0000 + zeitgeist (0.9.16-0ubuntu2) wily; urgency=medium * debian/patches/fix-test-crash.patch: diff --git a/debian/patches/fix-test-crash.patch b/debian/patches/fix-test-crash.patch index a8b22ba..e02fd92 100644 --- a/debian/patches/fix-test-crash.patch +++ b/debian/patches/fix-test-crash.patch @@ -12,16 +12,17 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91443 extensions/fts++/test/test-stringutils.cpp | 138 +++++++++++++++++++---------- 1 file changed, 91 insertions(+), 47 deletions(-) -diff --git a/extensions/fts++/test/test-stringutils.cpp b/extensions/fts++/test/test-stringutils.cpp -index 7bb34fe..98c868e 100644 +Index: b/extensions/fts++/test/test-stringutils.cpp +=================================================================== --- a/extensions/fts++/test/test-stringutils.cpp +++ b/extensions/fts++/test/test-stringutils.cpp -@@ -45,42 +45,66 @@ teardown (Fixture *fix, gconstpointer data) +@@ -45,42 +45,66 @@ static void test_truncate (Fixture *fix, gconstpointer data) { - g_assert_cmpstr ("", ==, StringUtils::Truncate("").c_str ()); -- ++ std::string truncated; + - g_assert_cmpstr ("", ==, StringUtils::Truncate("a", 0).c_str ()); - g_assert_cmpstr ("a", ==, StringUtils::Truncate("a", 1).c_str ()); - g_assert_cmpstr ("a", ==, StringUtils::Truncate("a").c_str ()); @@ -42,8 +43,6 @@ index 7bb34fe..98c868e 100644 - g_assert_cmpstr ("å", ==, StringUtils::Truncate("åå", 3).c_str ()); - g_assert_cmpstr ("åå", ==, StringUtils::Truncate("åå", 4).c_str ()); - g_assert_cmpstr ("åå", ==, StringUtils::Truncate("åå").c_str ()); -+ std::string truncated; -+ + truncated = StringUtils::Truncate(""); + g_assert_cmpstr ("", ==, truncated.c_str ()); + @@ -112,7 +111,7 @@ index 7bb34fe..98c868e 100644 } static void -@@ -189,44 +213,64 @@ test_ascii_fold (Fixture *fix, gconstpointer data) +@@ -189,44 +213,64 @@ static void test_underscores (Fixture *fix, gconstpointer data) { @@ -195,6 +194,3 @@ index 7bb34fe..98c868e 100644 } static void --- -2.4.6 - diff --git a/debian/patches/series b/debian/patches/series index b4b7a4e..fc874c4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ nodisplay_autostart.patch pre_populator.patch skip-failing-tests.patch fix-test-crash.patch +startup-database-vacuum.patch diff --git a/debian/patches/startup-database-vacuum.patch b/debian/patches/startup-database-vacuum.patch new file mode 100644 index 0000000..011deb9 --- /dev/null +++ b/debian/patches/startup-database-vacuum.patch @@ -0,0 +1,214 @@ +Description: Use execute a VACUUM operation on activity DB on startups every 10 days +Author: Marco Trevisan +Bug-Ubuntu: https://launchpad.net/bugs/919801 +Forwarded: http://irclogs.ubuntu.com/2016/02/24/#ubuntu-desktop.html#t10:44 + +Index: b/src/Makefile.am +=================================================================== +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1,6 +1,7 @@ + NULL = + + bin_PROGRAMS = zeitgeist-daemon ++pkglibexec_PROGRAMS = zeitgeist-vacuum + noinst_LTLIBRARIES = libzeitgeist-engine.la + + AM_CPPFLAGS = \ +@@ -33,6 +34,7 @@ + libzeitgeist_engine_la_vala.stamp \ + extensions_vala.stamp \ + zeitgeist_daemon_vala.stamp \ ++ zeitgeist_vacuum_vala.stamp \ + $(NULL) + + # Make sure every extension has only one vala file! +@@ -72,6 +74,17 @@ + zeitgeist_daemon_LDADD = $(builddir)/libzeitgeist-engine.la $(top_builddir)/libzeitgeist/libzeitgeist-2.0.la $(ZEITGEIST_LIBS) + zeitgeist_daemon_LDFLAGS = -export-dynamic -no-undefined + ++zeitgeist_vacuum_VALASOURCES = \ ++ zeitgeist-vacuum.vala \ ++ $(NULL) ++ ++nodist_zeitgeist_vacuum_SOURCES = \ ++ $(zeitgeist_vacuum_VALASOURCES:.vala=.c) \ ++ $(NULL) ++ ++zeitgeist_vacuum_LDADD = $(top_builddir)/libzeitgeist/libzeitgeist-2.0.la $(ZEITGEIST_LIBS) ++zeitgeist_vacuum_LDFLAGS = -export-dynamic -no-undefined ++ + libzeitgeist_engine_la_LIBADD = $(ZEITGEIST_LIBS) + libzeitgeist_engine_la_LDFLAGS = -avoid-version -non_shared -static + +@@ -101,15 +114,23 @@ + $(filter %.vala %.c,$^) + $(AM_V_at)touch $@ + ++zeitgeist_vacuum_vala.stamp: $(zeitgeist_vacuum_VALASOURCES) Makefile ++ $(AM_V_VALA)$(VALAC) \ ++ $(AM_VALAFLAGS) \ ++ $(filter %.vala %.c,$^) ++ $(AM_V_at)touch $@ ++ + EXTRA_DIST = \ + $(libzeitgeist_engine_la_VALASOURCES) \ + $(zeitgeist_daemon_VALASOURCES) \ ++ $(zeitgeist_vacuum_VALASOURCES) \ + $(extensions_VALASOURCES) \ + $(NULL) + + CLEANFILES = \ + $(nodist_libzeitgeist_engine_la_SOURCES) \ + $(nodist_zeitgeist_daemon_SOURCES) \ ++ $(nodist_zeitgeist_vacuum_SOURCES) \ + zeitgeist-engine.vapi \ + zeitgeist-engine.h \ + $(NULL) +Index: b/src/zeitgeist-vacuum.vala +=================================================================== +--- /dev/null ++++ b/src/zeitgeist-vacuum.vala +@@ -0,0 +1,56 @@ ++/* zeitgeist-vacuum.vala ++ * ++ * Copyright © 2015 Marco Trevisan ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License as published by ++ * the Free Software Foundation, either version 2.1 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this program. If not, see . ++ * ++ */ ++ ++using Zeitgeist; ++ ++int main (string[] args) ++{ ++ Sqlite.Database database; ++ ++ if (Utils.using_in_memory_database ()) ++ { ++ warning ("Using in-memory database, no VACUUM needed"); ++ } ++ ++ var db_path = Utils.get_database_file_path (); ++ debug (@"Opening database file at $db_path"); ++ ++ int rc = Sqlite.Database.open_v2 (db_path, out database, Sqlite.OPEN_READWRITE); ++ ++ if (rc != Sqlite.OK) ++ { ++ warning ("Impossible to open database `%s': %s".printf (db_path, database.errmsg ())); ++ return rc; ++ } ++ ++ print ("Performing VACUUM operation... "); ++ rc = database.exec ("VACUUM"); ++ ++ if (rc != Sqlite.OK) ++ { ++ print ("FAIL"); ++ warning (database.errmsg ()); ++ return rc; ++ } ++ ++ print("OK\n"); ++ return 0; ++} ++ ++// vim:expandtab:ts=4:sw=4 +Index: b/data/Makefile.am +=================================================================== +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -8,9 +8,15 @@ + service_DATA = org.gnome.zeitgeist.service + + org.gnome.zeitgeist.service: org.gnome.zeitgeist.service.in +- $(AM_V_GEN)sed -e s!\@prefix\@!$(prefix)! < $< > $@ ++ $(AM_V_GEN)sed -e "s!\@prefix\@!$(prefix)!; s!\@pkglibexecdir\@!$(pkglibexecdir)!" < $< > $@ + org.gnome.zeitgeist.service: Makefile + ++pkglibexec_PROGRAMS = zeitgeist-maybe-vacuum ++ ++zeitgeist-maybe-vacuum: zeitgeist-maybe-vacuum.in ++ $(AM_V_GEN)sed -e s!\@pkglibexecdir\@!$(pkglibexecdir)! < $< > $@ ++zeitgeist-maybe-vacuum: Makefile ++ + bashcompletiondir = $(datadir)/bash-completion/completions + dist_bashcompletion_DATA = completions/zeitgeist-daemon + +@@ -27,15 +33,17 @@ + org.gnome.zeitgeist.service \ + PythonSerializer.pyc \ + zeitgeist-datahub.desktop \ ++ zeitgeist-maybe-vacuum \ + $(NULL) + + EXTRA_DIST = \ + org.gnome.zeitgeist.service.in \ + ontology2code \ ++ zeitgeist-maybe-vacuum.in \ + $(xdgautostart_in_files) \ + $(NULL) + +-all-local: org.gnome.zeitgeist.service ++all-local: org.gnome.zeitgeist.service zeitgeist-maybe-vacuum + + clean: + rm -rf *.pyc *.~[0-9]~ +Index: b/data/zeitgeist-maybe-vacuum.in +=================================================================== +--- /dev/null ++++ b/data/zeitgeist-maybe-vacuum.in +@@ -0,0 +1,32 @@ ++#!/bin/sh ++ ++FREQUENCY=864000 # 10 days ++ ++cache_dir="$HOME/.cache" ++ ++if [ -n "$XDG_CACHE_HOME" ]; then ++ cache_dir="$XDG_CACHE_HOME" ++fi ++ ++stamp_file="$cache_dir/zeitgeist-vacuum.stamp" ++timestamp=0 ++ ++if [ -f "$stamp_file" ]; then ++ timestamp="$(cat $stamp_file)" ++fi ++ ++case $timestamp in ++ ''|*[!0-9]*) timestamp=0 ;; ++ *) ;; ++esac ++ ++if [ $(($(date +%s) - $timestamp)) -lt $FREQUENCY ]; then ++ exit 0; ++fi ++ ++if (@pkglibexecdir@/zeitgeist-vacuum); then ++ mkdir -p "$cache_dir" ++ date +%s > "$stamp_file" ++else ++ exit $? ++fi +Index: b/data/org.gnome.zeitgeist.service.in +=================================================================== +--- a/data/org.gnome.zeitgeist.service.in ++++ b/data/org.gnome.zeitgeist.service.in +@@ -1,3 +1,3 @@ + [D-BUS Service] + Name=org.gnome.zeitgeist.Engine +-Exec=@prefix@/bin/zeitgeist-daemon ++Exec=/bin/sh -c "@pkglibexecdir@/zeitgeist-maybe-vacuum; @prefix@/bin/zeitgeist-daemon" diff --git a/debian/zeitgeist-core.install b/debian/zeitgeist-core.install index 6ea93f9..2c72b48 100644 --- a/debian/zeitgeist-core.install +++ b/debian/zeitgeist-core.install @@ -1,4 +1,5 @@ usr/lib/*/zeitgeist-fts +usr/lib/*/zeitgeist/ usr/bin/zeitgeist-daemon usr/share/bash-completion/completions/zeitgeist-daemon usr/share/dbus-1/services/org.gnome.zeitgeist.service -- cgit v1.2.3