]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/find.c
Tweak
[bacula/bacula] / bacula / src / findlib / find.c
index 88b0bd08d494fc9828696fb1b25e94098c97b232..ad40a393f27814c3dddaeebd6316dfe31aa380c5 100644 (file)
@@ -20,7 +20,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -99,7 +99,7 @@ set_find_options(FF_PKT *ff, int incremental, time_t save_time)
 void
 set_find_changed_function(FF_PKT *ff, bool check_fct(JCR *jcr, FF_PKT *ff))
 {
-   Dmsg0(1, "Enter set_find_changed_function()\n");
+   Dmsg0(100, "Enter set_find_changed_function()\n");
    ff->check_fct = check_fct;
 }
 
@@ -215,6 +215,46 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT *ff_pkt, bool to
    return 1;
 }
 
+/*
+ * Test if the currently selected directory (in ff->fname) is
+ *  explicitly in the Include list or explicitly in the Exclude 
+ *  list.
+ */
+bool is_in_fileset(FF_PKT *ff)
+{
+   dlistString *node;
+   char *fname;
+   int i;
+   findINCEXE *incexe;
+   findFILESET *fileset = ff->fileset;
+   if (fileset) {
+      for (i=0; i<fileset->include_list.size(); i++) {
+         incexe = (findINCEXE *)fileset->include_list.get(i);
+         foreach_dlist(node, &incexe->name_list) {
+            fname = node->c_str();
+            Dmsg2(100, "Inc fname=%s ff->fname=%s\n", fname, ff->fname);
+            if (strcmp(fname, ff->fname) == 0) {
+               return true;
+            }
+         }
+      }
+#ifdef xxx
+      for (i=0; i<fileset->exclude_list.size(); i++) {
+         incexe = (findINCEXE *)fileset->exclude_list.get(i);
+         foreach_dlist(node, &incexe->name_list) {
+            fname = node->c_str();
+            Dmsg2(000, "Exc fname=%s ff->fname=%s\n", fname, ff->fname);
+            if (strcmp(fname, ff->fname) == 0) {
+               return true;
+            }
+         }
+      }
+#endif
+   }
+   return false;
+}
+
+
 static bool accept_file(FF_PKT *ff)
 {
    int i, j, k;
@@ -240,6 +280,7 @@ static bool accept_file(FF_PKT *ff)
       findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
       ff->flags = fo->flags;
       ff->GZIP_level = fo->GZIP_level;
+      ff->ignoredir = fo->ignoredir;
       ff->fstypes = fo->fstype;
       ff->drivetypes = fo->drivetype;