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.kondras...@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


Reply via email to