[Pkg-owncloud-commits] [owncloud-client] 95/219: owncloudcmd: restart the sync if required
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit a4dbf5942c09f1cf425c46724d7eef2c3c6aae1b
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Fri Sep 12 17:22:02 2014 +0200
owncloudcmd: restart the sync if required
Fixes #2038
---
csync/tests/ownCloud/t7.pl | 4 ----
src/owncloudcmd/owncloudcmd.cpp | 7 +++++++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/csync/tests/ownCloud/t7.pl b/csync/tests/ownCloud/t7.pl
index 8a2eb20..869372f 100755
--- a/csync/tests/ownCloud/t7.pl
+++ b/csync/tests/ownCloud/t7.pl
@@ -176,8 +176,6 @@ system("sqlite3 " . localDir().'.csync_journal.db .dump');
#new directory should be uploaded
system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_' );
-# two syncs may be necessary for now: https://github.com/owncloud/mirall/issues/2038
-csync();
csync();
system("sqlite3 " . localDir().'.csync_journal.db .dump');
assertCsyncJournalOk(localDir());
@@ -209,8 +207,6 @@ system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDi
#2. move a directory from read to read only (move the directory from previous step)
system("mv " . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_ ' . localDir().'readonlyDirectory_PERM_M_/moved_PERM_CK_' );
-# two syncs may be necessary for now: https://github.com/owncloud/mirall/issues/2038
-csync();
csync();
assertCsyncJournalOk(localDir());
diff --git a/src/owncloudcmd/owncloudcmd.cpp b/src/owncloudcmd/owncloudcmd.cpp
index 1f5e80e..543717b 100644
--- a/src/owncloudcmd/owncloudcmd.cpp
+++ b/src/owncloudcmd/owncloudcmd.cpp
@@ -161,6 +161,8 @@ int main(int argc, char **argv) {
account.setSslErrorHandler(sslErrorHandler);
AccountManager::instance()->setAccount(&account);
+restart_sync:
+
CSYNC *_csync_ctx;
if( csync_create( &_csync_ctx, options.source_dir.toUtf8(),
options.target_url.toUtf8()) < 0 ) {
@@ -238,6 +240,11 @@ int main(int argc, char **argv) {
ne_sock_exit();
+ if (engine.isAnotherSyncNeeded()) {
+ qDebug() << "Restarting Sync, because another sync is needed";
+ goto restart_sync;
+ }
+
return 0;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list