summaryrefslogtreecommitdiff
path: root/debuginfod
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2023-04-21 17:04:08 -0400
committerFrank Ch. Eigler <fche@redhat.com>2023-04-22 21:12:16 -0400
commitcded466a74d06fe1dff047b33e630f8a6aa721e1 (patch)
treec73c02896d3ceed007f6f6346b474dc43ffa69cc /debuginfod
parent51373aa9a77ef53d237edc1af664efcbb49f1bf5 (diff)
downloadelfutils-cded466a74d06fe1dff047b33e630f8a6aa721e1.tar.gz
PR30377: fix debuginfod -r -X combination
Until this fix, debuginfod -r -X '.*' didn't trigger groom-time removal of everything, because the -I include regex overrode it. Corrected logic to match the scan-time tie-breaking between -I / -X. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Diffstat (limited to 'debuginfod')
-rw-r--r--debuginfod/ChangeLog4
-rw-r--r--debuginfod/debuginfod.cxx2
2 files changed, 5 insertions, 1 deletions
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 070dad03..0e4810bb 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,7 @@
+2023-04-21 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfod.cxx (groom): Fix -r / -X logic.
+
2023-04-13 Frank Ch. Eigler <fche@redhat.com>
* debuginfod.cxx (archive_classify, scan_archive_file): Catch and
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index e981d137..a1ddeb56 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -3893,7 +3893,7 @@ void 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;
+ regex_file_drop = !reg_include || reg_exclude; // match logic of scan_source_paths
}
rc = stat(filename, &s);