[RFC PATCH v2 01/10] get_maintainer: Survive querying missing files

Nikolai Kondrashov
2023-12-05T18:45:40Z

Do not die, but only warn when scripts/get_maintainer.pl is asked to
retrieve information about a missing file.

This allows scripts/checkpatch.pl to query MAINTAINERS while processing
patches which are removing files.

Signed-off-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
---
scripts/get_maintainer.pl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 16d8ac6005b6f..37901c2298388 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -541,7 +541,11 @@ foreach my $file (@ARGV) {
if ((-d $file)) {
$file =~ s@([^/])$@$1/@;
} elsif (!(-f $file)) {
- die "$P: file '${file}' not found\n";
+ if ($from_filename) {
+ warn "$P: file '${file}' not found\n";
+ } else {
+ die "$P: file '${file}' not found\n";
+ }
}
}
if ($from_filename && (vcs_exists() && !vcs_file_exists($file))) {
--
2.42.0