[Pkg-owncloud-commits] [owncloud-client] 55/121: owncloudcmd: Fix --exclude regression

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Jul 28 15:31:57 UTC 2016


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 c0b0bd5b639bdd1d223497e375d55f1c080d290e
Author: Christian Kamm <mail at ckamm.de>
Date:   Wed Jun 22 15:30:20 2016 +0200

    owncloudcmd: Fix --exclude regression
    
    It's ok if the system exclude file is missing when --exclude is
    specified explicitly.
---
 src/cmd/cmd.cpp | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp
index ab26a42..9fe32aa 100644
--- a/src/cmd/cmd.cpp
+++ b/src/cmd/cmd.cpp
@@ -443,16 +443,27 @@ restart_sync:
     QObject::connect(&engine, SIGNAL(finished(bool)), &app, SLOT(quit()));
     QObject::connect(&engine, SIGNAL(transmissionProgress(ProgressInfo)), &cmd, SLOT(transmissionProgressSlot()));
 
+
     // Exclude lists
-    engine.excludedFiles().addExcludeFilePath(ConfigFile::excludeFileFromSystem());
-    if( QFile::exists(options.exclude) )
+
+    bool hasUserExcludeFile = !options.exclude.isEmpty();
+    QString systemExcludeFile = ConfigFile::excludeFileFromSystem();
+
+    // Always try to load the user-provided exclude list if one is specified
+    if ( hasUserExcludeFile ) {
         engine.excludedFiles().addExcludeFilePath(options.exclude);
+    }
+    // Load the system list if available, or if there's no user-provided list
+    if ( !hasUserExcludeFile || QFile::exists(systemExcludeFile) ) {
+        engine.excludedFiles().addExcludeFilePath(systemExcludeFile);
+    }
+
     if (!engine.excludedFiles().reloadExcludes()) {
-        // Always make sure at least one list has been loaded
         qFatal("Cannot load system exclude list or list supplied via --exclude");
         return EXIT_FAILURE;
     }
 
+
     // Have to be done async, else, an error before exec() does not terminate the event loop.
     QMetaObject::invokeMethod(&engine, "startSync", Qt::QueuedConnection);
 

-- 
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