diff mbox

[1/4] get_maintainer.pl: exit with status 1 if no maintainer found

Message ID 1413968902-24094-2-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Oct. 22, 2014, 9:08 a.m. UTC
This can be useful, at the very least, for debugging.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/get_maintainer.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Markus Armbruster Oct. 22, 2014, 12:09 p.m. UTC | #1
Paolo Bonzini <pbonzini@redhat.com> writes:

> This can be useful, at the very least, for debugging.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  scripts/get_maintainer.pl | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> index 38334de..a3a16d8 100755
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl
> @@ -55,7 +55,7 @@ my $help = 0;
>  
>  my $vcs_used = 0;
>  
> -my $exit = 0;
> +my $exit = 1;
>  
>  my %commit_author_hash;
>  my %commit_signer_hash;
> @@ -2061,6 +2061,7 @@ sub output {
>  	print(join($output_separator, @parms));
>  	print("\n");
>      }
> +    $exit = 0 if @parms > 0;
>  }
>  
>  my $rfc822re;

Not sure about "if no maintainer found".

Here's how output() gets called:

    if (@maintainers) {
        @maintainers = merge_email(@maintainers);
        output(@maintainers);
    }

    if ($scm) {
        @scm = uniq(@scm);
        output(@scm);
    }

    if ($status) {
        @status = uniq(@status);
        output(@status);
    }

    if ($subsystem) {
        @subsystem = uniq(@subsystem);
        output(@subsystem);
    }

    if ($web) {
        @web = uniq(@web);
        output(@web);
    }

    exit($exit);

Thus, the patch makes the script exit with status 1 when none of the
above output() calls produces output.

Maybe it exits with status 1 when it fails to produce output?  Obvious
ouput elsewhere: printing the version (okay), and a print in
get_maintainers().  Can't tell what the latter does.  Hmm.
diff mbox

Patch

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 38334de..a3a16d8 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -55,7 +55,7 @@  my $help = 0;
 
 my $vcs_used = 0;
 
-my $exit = 0;
+my $exit = 1;
 
 my %commit_author_hash;
 my %commit_signer_hash;
@@ -2061,6 +2061,7 @@  sub output {
 	print(join($output_separator, @parms));
 	print("\n");
     }
+    $exit = 0 if @parms > 0;
 }
 
 my $rfc822re;