]> git.proxmox.com Git - mirror_qemu.git/blobdiff - scripts/get_maintainer.pl
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[mirror_qemu.git] / scripts / get_maintainer.pl
index 1f637ff07696c3819122691109823d8ea6fc97db..71415e3c706106958eb0a85cb98e921ba73077a9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 # (c) 2007, Joe Perches <joe@perches.com>
 #           created from checkpatch.pl
 #
@@ -11,6 +11,7 @@
 # Licensed under the terms of the GNU GPL License version 2
 
 use strict;
+use warnings;
 
 my $P = $0;
 my $V = '0.26';
@@ -380,8 +381,8 @@ foreach my $file (@ARGV) {
        ##if $file is a directory and it lacks a trailing slash, add one
        if ((-d $file)) {
            $file =~ s@([^/])$@$1/@;
-       } elsif (!(-f $file)) {
-           die "$P: file '${file}' not found\n";
+       } elsif (!(stat $file)) {
+           die "$P: file '${file}' not found: $!\n";
        }
     }
     if ($from_filename) {
@@ -748,7 +749,7 @@ Other options:
   --help => show this help information
 
 Default options:
-  [--email --nogit --git-fallback --m --n --l --multiline --pattern-depth=0
+  [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-depth=0
    --remove-duplicates --rolestats]
 
 Notes:
@@ -896,20 +897,29 @@ sub find_ending_index {
     return $index;
 }
 
-sub get_maintainer_role {
+sub get_subsystem_name {
     my ($index) = @_;
 
-    my $i;
     my $start = find_starting_index($index);
-    my $end = find_ending_index($index);
 
-    my $role = "unknown";
     my $subsystem = $typevalue[$start];
     if (length($subsystem) > 20) {
        $subsystem = substr($subsystem, 0, 17);
        $subsystem =~ s/\s*$//;
        $subsystem = $subsystem . "...";
     }
+    return $subsystem;
+}
+
+sub get_maintainer_role {
+    my ($index) = @_;
+
+    my $i;
+    my $start = find_starting_index($index);
+    my $end = find_ending_index($index);
+
+    my $role = "unknown";
+    my $subsystem = get_subsystem_name($index);
 
     for ($i = $start + 1; $i < $end; $i++) {
        my $tv = $typevalue[$i];
@@ -943,16 +953,7 @@ sub get_maintainer_role {
 sub get_list_role {
     my ($index) = @_;
 
-    my $i;
-    my $start = find_starting_index($index);
-    my $end = find_ending_index($index);
-
-    my $subsystem = $typevalue[$start];
-    if (length($subsystem) > 20) {
-       $subsystem = substr($subsystem, 0, 17);
-       $subsystem =~ s/\s*$//;
-       $subsystem = $subsystem . "...";
-    }
+    my $subsystem = get_subsystem_name($index);
 
     if ($subsystem eq "THE REST") {
        $subsystem = "";
@@ -1040,7 +1041,8 @@ sub add_categories {
                    }
                }
                if ($email_reviewer) {
-                   push_email_addresses($pvalue, 'reviewer');
+                   my $subsystem = get_subsystem_name($i);
+                   push_email_addresses($pvalue, "reviewer:$subsystem");
                }
            } elsif ($ptype eq "T") {
                push(@scm, $pvalue);
@@ -1374,7 +1376,7 @@ sub vcs_exists {
        warn("$P: No supported VCS found.  Add --nogit to options?\n");
        warn("Using a git repository produces better results.\n");
        warn("Try latest git repository using:\n");
-       warn("git clone git://git.qemu-project.org/qemu.git\n");
+       warn("git clone https://git.qemu.org/git/qemu.git\n");
        $printed_novcs = 1;
     }
     return 0;