ephemeral sync: don't write binfile client files (FDO #55921)

When doing PBAP caching, we don't want any meta data written because
the next sync would not use it anyway. With the latest libsynthesis
we can configure "/dev/null" as datadir for the client's binfiles and
libsynthesis will avoid writing them.

The PIM manager uses this for PBAP syncing automatically. For testing
it can be enabled by setting the SYNCEVOLUTION_EPHEMERAL env variable.
This commit is contained in:
Patrick Ohly 2014-07-22 16:04:03 +02:00
parent 198594b622
commit 834c1e7a6b
3 changed files with 8 additions and 4 deletions

View File

@ -25,7 +25,7 @@ SE_CHECK_FOR_STABLE_RELEASE
# Minimum version of libsynthesis as defined in its
# configure script and thus .pc files:
define([SYNTHESIS_MIN_VERSION], [3.4.0.47.2])
define([SYNTHESIS_MIN_VERSION], [3.4.0.47.3])
# Line above is patched by gen-autotools.sh. Handle
# both "yes" and "no".

View File

@ -970,8 +970,6 @@ XDG root.
xdg_root + '/cache/syncevolution/target_.config@[^/]*$'])
# - some files which are allowed to be written
exclude.extend([xdg_root + '/cache/syncevolution/[^/]*/(status.ini|syncevolution-log.html)$'])
# - synthesis client files (should not be written at all, but that's harder - redirect into cache for now)
exclude.extend([xdg_root + '/cache/syncevolution/[^/]*/synthesis(/|$)'])
# Now compare files and their modification time stamp.
# SYNCEVOLUTION_LOGLEVEL can be used to increase verbosity

View File

@ -3310,6 +3310,11 @@ SyncMLStatus SyncContext::sync(SyncReport *report)
checkConfig("sync");
if (getenv("SYNCEVOLUTION_EPHEMERAL")) {
SE_LOG_INFO(NULL, "turning on ephemeral sync mode as requested by SYNCEVOLUTION_EPHEMERAL variable");
makeEphemeral();
}
// redirect logging as soon as possible
SourceList sourceList(*this, m_doLogging);
sourceList.setLogLevel(m_quiet ? SourceList::LOGGING_QUIET :
@ -4409,7 +4414,8 @@ SyncMLStatus SyncContext::doSync()
string SyncContext::getSynthesisDatadir()
{
if (isEphemeral() && m_sourceListPtr) {
return m_sourceListPtr->getLogdir() + "/synthesis";
// Suppress writing in libsynthesis binfile client.
return "/dev/null";
} else if (m_localSync && !m_serverMode) {
return m_localClientRootPath + "/.synthesis";
} else {