rpms/akonadi/devel akonadi-1.1.1-startup-1.patch, NONE, 1.1 akonadi.spec, 1.25, 1.26

Rex Dieter rdieter at fedoraproject.org
Tue Feb 24 18:06:30 UTC 2009


Author: rdieter

Update of /cvs/pkgs/rpms/akonadi/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2193

Modified Files:
	akonadi.spec 
Added Files:
	akonadi-1.1.1-startup-1.patch 
Log Message:
* Tue Feb 24 2009 Rex Dieter <rdieter at fedoraproject.org> - 1.1.1-5
- own %_sysconfig/akonadi/mysql-local.conf
- startup patch: reset conf only when needed, and clear mysql log file on update


akonadi-1.1.1-startup-1.patch:

--- NEW FILE akonadi-1.1.1-startup-1.patch ---
diff -up akonadi-1.1.1/server/src/akonadi.cpp.startup akonadi-1.1.1/server/src/akonadi.cpp
--- akonadi-1.1.1/server/src/akonadi.cpp.startup	2009-01-21 12:29:03.000000000 -0600
+++ akonadi-1.1.1/server/src/akonadi.cpp	2009-02-24 11:58:47.000000000 -0600
@@ -226,24 +226,30 @@ void AkonadiServer::startDatabaseProcess
   if ( globalConfig.isEmpty() )
     akFatal() << "Did not find MySQL server default configuration (mysql-global.conf)";
   QFile globalFile( globalConfig );
-  QFile actualFile( actualConfig );
-  if ( globalFile.open( QFile::ReadOnly ) && actualFile.open( QFile::WriteOnly ) ) {
+  QFile localFile ( localConfig );
+  QFile actualFile ( actualConfig );
+  bool confUpdate = false;
+  // update conf only if either global (or local) is newer than actual 
+  if ( ( ( QFileInfo(globalFile).lastModified() > QFileInfo(actualFile).lastModified()) ||
+         ( QFileInfo(localFile).lastModified()  > QFileInfo(actualFile).lastModified()) ) &&
+       ( globalFile.open( QFile::ReadOnly ) && actualFile.open( QFile::WriteOnly ) ) ) { 
     actualFile.write( globalFile.readAll() );
     if ( !localConfig.isEmpty() ) {
-      QFile localFile( localConfig );
       if ( localFile.open( QFile::ReadOnly ) ) {
         actualFile.write( localFile.readAll() );
-        localFile.close();
       }
     }
-    actualFile.close();
-    globalFile.close();
+    confUpdate = true;
   } else {
     akError() << "Unable to create MySQL server configuration file.";
     akError() << "This means that either the default configuration file (mysql-global.conf) was not readable";
     akFatal() << "or the target file (mysql.conf) could not be written.";
   }
 
+  globalFile.close();
+  localFile.close();
+  actualFile.close();
+
   // MySQL doesn't like world writeable config files (which makes sense), but
   // our config file somehow ends up being world-writable on some systems for no
   // apparent reason nevertheless, so fix that
@@ -276,6 +282,12 @@ void AkonadiServer::startDatabaseProcess
     }
   }
 
+  // clear mysql ib_logfile's in case innodb_log_file_size option changed in last confUpdate
+  if ( confUpdate ) {
+      QFile(dataDir + QDir::separator() + QString::fromLatin1( "ib_logfile0" )).remove();
+      QFile(dataDir + QDir::separator() + QString::fromLatin1( "ib_logfile1" )).remove();
+  }
+
   // synthesize the mysqld command
   QStringList arguments;
   arguments << QString::fromLatin1( "--defaults-file=%1/mysql.conf" ).arg( akDir );


Index: akonadi.spec
===================================================================
RCS file: /cvs/pkgs/rpms/akonadi/devel/akonadi.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- akonadi.spec	24 Feb 2009 00:24:44 -0000	1.25
+++ akonadi.spec	24 Feb 2009 18:05:59 -0000	1.26
@@ -1,7 +1,7 @@
 Summary: PIM Storage Service
 Name:    akonadi
 Version: 1.1.1
-Release: 4%{?dist}
+Release: 5%{?dist}
 
 Group:   System Environment/Libraries
 License: LGPLv2+
@@ -12,6 +12,9 @@
 # shrink default initial db size a bit (approx 140mb->28mb)
 Patch1: akonadi-1.1.1-mysql_conf.patch
 
+# upstreamable
+Patch50: akonadi-1.1.1-startup-1.patch
+
 BuildRequires: cmake
 BuildRequires: qt4-devel >= 4.4
 BuildRequires: automoc4
@@ -52,6 +55,7 @@
 %setup -q 
 
 %patch1 -p1 -b .mysql_conf
+%patch50 -p1 -b .startup-1
 
 
 %build
@@ -71,6 +75,8 @@
 make install DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
 mkdir -p $RPM_BUILD_ROOT%{_datadir}/akonadi/agents
 
+touch $RPM_BUILD_ROOT%{_sysconfdir}/akonadi/mysql-local.conf
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -90,6 +96,7 @@
 %doc AUTHORS lgpl-license
 %dir %{_sysconfdir}/akonadi/
 %config(noreplace) %{_sysconfdir}/akonadi/mysql-global.conf
+%config(noreplace) %{_sysconfdir}/akonadi/mysql-local.conf
 %{_bindir}/akonadi_control
 %{_bindir}/akonadictl
 %{_bindir}/akonadiserver
@@ -108,6 +115,10 @@
 
 
 %changelog
+* Tue Feb 24 2009 Rex Dieter <rdieter at fedoraproject.org> - 1.1.1-5
+- own %%_sysconfig/akonadi/mysql-local.conf
+- startup patch: reset conf only when needed, and clear mysql log file on update
+
 * Mon Feb 23 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1.1-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the scm-commits mailing list