瀏覽代碼

more than one excludeCommand
excludeFile compiled to excludeCommand

Wolfgang Ortmann 9 年之前
父節點
當前提交
a6e9273d15
共有 1 個文件被更改,包括 9 次插入8 次删除
  1. 9 8
      src/excludetools.cpp

+ 9 - 8
src/excludetools.cpp

@@ -6,13 +6,13 @@
 
 
 using namespace std;
 using namespace std;
 
 
-Strings getExclusions(const KindConfig& conf, bool shellMode)
+Strings getExclusions(const KindConfig& conf)
 {
 {
   Strings exclusions;
   Strings exclusions;
   if (conf.hasKey("exclude"))
   if (conf.hasKey("exclude"))
     exclusions += conf.getStrings("exclude");
     exclusions += conf.getStrings("exclude");
 
 
-  if (shellMode)
+  if (conf.getBool("shellMode"))
     {
     {
       string path = conf.getString("path");
       string path = conf.getString("path");
       string remoteShell = conf.getString("remoteShell");
       string remoteShell = conf.getString("remoteShell");
@@ -23,16 +23,16 @@ Strings getExclusions(const KindConfig& conf, bool shellMode)
 
 
       rshCommand += " " + userAtHost;
       rshCommand += " " + userAtHost;
 
 
-      string userExcludeCommand = conf.getString("userExcludeCommand");
+      Strings userExcludeCommands = conf.getStrings("userExcludeCommand");
 
 
-      if (!userExcludeCommand.empty())
+      for (auto cmd : userExcludeCommands)
         {
         {
-          replacePlaceHolder(userExcludeCommand, "%path", conf.getString("path"));
+          replacePlaceHolder(cmd, "%path", conf.getString("path"));
 
 
-          verbosePrint("searching for exclusions (" + userExcludeCommand + ")");
+          verbosePrint("looking for exclusions (" + cmd + ")");
 
 
           int rc;
           int rc;
-          Strings excludedFiles = remoteExec(rshCommand, userExcludeCommand, rc, debug);
+          Strings excludedFiles = remoteExec(rshCommand, cmd, rc, debug);
           if (rc > 0)
           if (rc > 0)
             {
             {
               // return Strings should contain error messages
               // return Strings should contain error messages
@@ -46,7 +46,7 @@ Strings getExclusions(const KindConfig& conf, bool shellMode)
               debugPrint("Excluding: " + exclusions.back());
               debugPrint("Excluding: " + exclusions.back());
             }
             }
         }
         }
-
+      /*
       string userExcludeFile = conf.getString("userExcludeFile");
       string userExcludeFile = conf.getString("userExcludeFile");
       if (!userExcludeFile.empty())
       if (!userExcludeFile.empty())
         {
         {
@@ -59,6 +59,7 @@ Strings getExclusions(const KindConfig& conf, bool shellMode)
           if (rc == 0)
           if (rc == 0)
             exclusions += excludes2;
             exclusions += excludes2;
         } // if (shellMode)
         } // if (shellMode)
+      */
     }
     }
   return exclusions;
   return exclusions;
 }
 }