[akonadi] pull in a few upstream fixes

Rex Dieter rdieter at fedoraproject.org
Fri Feb 8 15:26:10 UTC 2013


commit 6c7a48acda2c0c52ecf73bf3005fdd261b777564
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Fri Feb 8 09:25:55 2013 -0600

    pull in a few upstream fixes

 ...-disable-the-cache-for-the-SQlite-backend.patch |   48 ++++++++++++++++++++
 ...o-start-akonadiserver-if-mysqld-is-not-in.patch |   29 ++++++++++++
 0003-Ignore-the-custom-settings-in-.my.cnf.patch   |   42 +++++++++++++++++
 akonadi.spec                                       |   12 +++++-
 4 files changed, 130 insertions(+), 1 deletions(-)
---
diff --git a/0001-disable-the-cache-for-the-SQlite-backend.patch b/0001-disable-the-cache-for-the-SQlite-backend.patch
new file mode 100644
index 0000000..2fab772
--- /dev/null
+++ b/0001-disable-the-cache-for-the-SQlite-backend.patch
@@ -0,0 +1,48 @@
+From c2e9a4140ddbd7374c8f60e4ed644b73cc3533f0 Mon Sep 17 00:00:00 2001
+From: Marco Martin <notmart at gmail.com>
+Date: Mon, 28 Jan 2013 10:25:44 +0100
+Subject: [PATCH 1/3] disable the cache for the SQlite backend
+
+using the cache for sqlite makes impossible to create agents
+---
+ server/src/storage/querycache.cpp | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/server/src/storage/querycache.cpp b/server/src/storage/querycache.cpp
+index 860aba0..5b683d5 100644
+--- a/server/src/storage/querycache.cpp
++++ b/server/src/storage/querycache.cpp
+@@ -18,6 +18,8 @@
+  */
+ 
+ #include "querycache.h"
++#include "dbtype.h"
++#include "datastore.h"
+ 
+ #include <QSqlQuery>
+ #include <QThreadStorage>
+@@ -36,7 +38,11 @@ static QHash<QString, QSqlQuery>* cache()
+ 
+ bool QueryCache::contains(const QString& queryStatement)
+ {
+-  return cache()->contains( queryStatement );
++  if ( DbType::type( DataStore::self()->database() ) == DbType::Sqlite ) {
++    return false;
++  } else {
++    return cache()->contains( queryStatement );
++  }
+ }
+ 
+ QSqlQuery QueryCache::query(const QString& queryStatement)
+@@ -46,5 +52,7 @@ QSqlQuery QueryCache::query(const QString& queryStatement)
+ 
+ void QueryCache::insert(const QString& queryStatement, const QSqlQuery& query)
+ {
+-  cache()->insert( queryStatement, query );
++  if ( DbType::type( DataStore::self()->database() ) != DbType::Sqlite ) {
++    cache()->insert( queryStatement, query );
++  }
+ }
+-- 
+1.8.1.2
+
diff --git a/0002-Don-t-try-to-start-akonadiserver-if-mysqld-is-not-in.patch b/0002-Don-t-try-to-start-akonadiserver-if-mysqld-is-not-in.patch
new file mode 100644
index 0000000..e68d159
--- /dev/null
+++ b/0002-Don-t-try-to-start-akonadiserver-if-mysqld-is-not-in.patch
@@ -0,0 +1,29 @@
+From 5d2968b8e7059f16ea3bd2d23114b13a9b9ad94d Mon Sep 17 00:00:00 2001
+From: Montel Laurent <montel at kde.org>
+Date: Thu, 7 Feb 2013 08:16:01 +0100
+Subject: [PATCH 2/3] Don't try to start akonadiserver if mysqld is not install
+ on distro (cherry picked from commit
+ a2ad6ea98cfeae6a03ec02d9132d7c60dfbe9683)
+
+---
+ server/src/storage/dbconfigmysql.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/server/src/storage/dbconfigmysql.cpp b/server/src/storage/dbconfigmysql.cpp
+index 6712338..c9491e0 100644
+--- a/server/src/storage/dbconfigmysql.cpp
++++ b/server/src/storage/dbconfigmysql.cpp
+@@ -262,6 +262,10 @@ void DbConfigMysql::startInternalServer()
+   arguments << QString::fromLatin1( "--shared-memory" );
+ #endif
+ 
++  if (mysqldPath.isEmpty()) {
++    akError() << "mysqld not found. Please verify your installation";
++    return;
++  }
+   mDatabaseProcess = new QProcess;
+   mDatabaseProcess->start( mysqldPath, arguments );
+   if ( !mDatabaseProcess->waitForStarted() ) {
+-- 
+1.8.1.2
+
diff --git a/0003-Ignore-the-custom-settings-in-.my.cnf.patch b/0003-Ignore-the-custom-settings-in-.my.cnf.patch
new file mode 100644
index 0000000..181671d
--- /dev/null
+++ b/0003-Ignore-the-custom-settings-in-.my.cnf.patch
@@ -0,0 +1,42 @@
+From b45e783ebe548280f78c0a659a6f8c6f7e09e3ea Mon Sep 17 00:00:00 2001
+From: Christophe Giboudeaux <cgiboudeaux at gmx.com>
+Date: Thu, 7 Feb 2013 16:59:03 +0100
+Subject: [PATCH 3/3] Ignore the custom settings in ~/.my.cnf Looks like
+ passing the socket path in our arguments is not enough for MySQL. It still
+ tries to run the commands on any database defined in ~/.my.cnf.
+
+We're now adding the --defaults-file argument to mysqladmin and mysqlcheck to only run these commands on the Akonadi DB.
+
+BUG: 264383
+FIXED-IN: 1.9.1
+---
+ server/src/storage/dbconfigmysql.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/server/src/storage/dbconfigmysql.cpp b/server/src/storage/dbconfigmysql.cpp
+index c9491e0..b76efe5 100644
+--- a/server/src/storage/dbconfigmysql.cpp
++++ b/server/src/storage/dbconfigmysql.cpp
+@@ -78,7 +78,8 @@ bool DbConfigMysql::init( QSettings &settings )
+   const QString mysqladminPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysqladmin" ), mysqldSearchPath );
+   if ( !mysqladminPath.isEmpty() ) {
+ #ifndef Q_OS_WIN
+-    defaultCleanShutdownCommand = QString::fromLatin1( "%1 shutdown --socket=%2/mysql.socket" )
++    defaultCleanShutdownCommand = QString::fromLatin1( "--defaults-file=%1/mysql.conf %2 shutdown --socket=%3/mysql.socket" )
++                                      .arg( AkStandardDirs::saveDir( "data" ) )
+                                       .arg( mysqladminPath )
+                                       .arg( socketDirectory );
+ #else
+@@ -303,7 +304,8 @@ void DbConfigMysql::startInternalServer()
+     if ( opened ) {
+ 
+       if ( !mMysqlCheckPath.isEmpty() ) {
+-        const QStringList arguments = QStringList() << QLatin1String( "--check-upgrade" )
++        const QStringList arguments = QStringList() << QString::fromLatin1( "--defaults-file=%1/mysql.conf" ).arg( akDir )
++                                                    << QLatin1String( "--check-upgrade" )
+                                                     << QLatin1String( "--all-databases" )
+                                                     << QLatin1String( "--auto-repair" )
+                                                     << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( socketDirectory );
+-- 
+1.8.1.2
+
diff --git a/akonadi.spec b/akonadi.spec
index ed3bac1..7d8f7b3 100644
--- a/akonadi.spec
+++ b/akonadi.spec
@@ -5,7 +5,7 @@
 Summary: PIM Storage Service
 Name:    akonadi
 Version: 1.9.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 License: LGPLv2+
 URL:     http://community.kde.org/KDE_PIM/Akonadi 
@@ -22,6 +22,9 @@ Source0: http://download.kde.org/stable/akonadi/src/akonadi-%{version}.tar.bz2
 Source10: akonadiserverrc.mysql
 
 ## upstream patches
+Patch101: 0001-disable-the-cache-for-the-SQlite-backend.patch
+Patch102: 0002-Don-t-try-to-start-akonadiserver-if-mysqld-is-not-in.patch
+Patch103: 0003-Ignore-the-custom-settings-in-.my.cnf.patch
 
 %define mysql_conf_timestamp 20110910
 
@@ -76,6 +79,10 @@ See also: %{_sysconfdir}/akonadi/mysql-global.conf
 %prep
 %setup -q -n akonadi-%{version}
 
+%patch101 -p1 -b .0001
+%patch102 -p1 -b .0002
+%patch103 -p1 -b .0003
+
 
 %build
 mkdir -p %{_target_platform}
@@ -192,6 +199,9 @@ fi
 
 
 %changelog
+* Fri Feb 08 2013 Rex Dieter <rdieter at fedoraproject.org> 1.9.0-2
+- pull in a few upstream fixes
+
 * Thu Jan 03 2013 Rex Dieter <rdieter at fedoraproject.org> 1.9.0-1
 - 1.9.0
 


More information about the scm-commits mailing list