diff options
Diffstat (limited to 'debuginfod/debuginfod.cxx')
-rw-r--r-- | debuginfod/debuginfod.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 303ffe00..a089d0bd 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -3580,11 +3580,17 @@ void groom() int64_t fileid = sqlite3_column_int64 (files, 1); const char* filename = ((const char*) sqlite3_column_text (files, 2) ?: ""); struct stat s; - bool reg_include = !regexec (&file_include_regex, filename, 0, 0, 0); - bool reg_exclude = !regexec (&file_exclude_regex, filename, 0, 0, 0); + bool regex_file_drop = 0; + + if (regex_groom) + { + bool reg_include = !regexec (&file_include_regex, filename, 0, 0, 0); + bool reg_exclude = !regexec (&file_exclude_regex, filename, 0, 0, 0); + regex_file_drop = reg_exclude && !reg_include; + } rc = stat(filename, &s); - if ( (regex_groom && reg_exclude && !reg_include) || rc < 0 || (mtime != (int64_t) s.st_mtime) ) + if ( regex_file_drop || rc < 0 || (mtime != (int64_t) s.st_mtime) ) { if (verbose > 2) obatched(clog) << "groom: stale file=" << filename << " mtime=" << mtime << endl; |