From 334b701e895a6ec517b26d05cf1266c25d518025 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 27 Feb 2008 21:35:30 +0000 Subject: [PATCH] Suppress incorrect 'Will not descend from x into y' messages git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6502 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/backup.c | 3 ++- bacula/src/findlib/find.c | 40 +++++++++++++++++++++++++++++++++++++ bacula/src/findlib/protos.h | 1 + bacula/technotes-2.3 | 1 + 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 04903db923..94c9e26056 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -552,7 +552,8 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level) break; case FT_NOFSCHG: /* Suppress message for /dev filesystems */ - if (strncmp(ff_pkt->fname, "/dev/", 5) != 0) { +// if (strncmp(ff_pkt->fname, "/dev/", 5) != 0) { + if (!is_in_fileset(ff_pkt)) { Jmsg(jcr, M_INFO, 1, _(" %s is a different filesystem. Will not descend from %s into %s\n"), ff_pkt->fname, ff_pkt->top_fname, ff_pkt->fname); } diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index 88b0bd08d4..e19cad5312 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -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; iinclude_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; iexclude_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; diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h index 5c6fd4599a..702959783b 100644 --- a/bacula/src/findlib/protos.h +++ b/bacula/src/findlib/protos.h @@ -51,6 +51,7 @@ int find_files(JCR *jcr, FF_PKT *ff, int file_sub(JCR *, FF_PKT *ff_pkt, bool) int match_files(JCR *jcr, FF_PKT *ff, int sub(JCR *, FF_PKT *ff_pkt, bool)); int term_find_files(FF_PKT *ff); int get_win32_driveletters(FF_PKT *ff, char* szDrives); +bool is_in_fileset(FF_PKT *ff); /* From match.c */ void init_include_exclude_files(FF_PKT *ff); diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 0b9b941b6d..82fd2905db 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,7 @@ General: 27Feb08 +kes Suppress incorrect 'Will not descend from x into y' messages. kes Eliminate FORTIFY_CODE=2 bug, and make first cut at removing daemon globals used by parser. kes Apply Joao's patch to separate DB_TYPE and DB_PROG in configure. -- 2.39.5