diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/dtc/dtx_diff | 2 | ||||
| -rw-r--r-- | scripts/parse-maintainers.pl | 77 | 
2 files changed, 78 insertions, 1 deletions
diff --git a/scripts/dtc/dtx_diff b/scripts/dtc/dtx_diff index fb86f3899e16..f9a3d8d23c64 100755 --- a/scripts/dtc/dtx_diff +++ b/scripts/dtc/dtx_diff @@ -321,7 +321,7 @@ fi  cpp_flags="\  	-nostdinc                                  \  	-I${srctree}/arch/${ARCH}/boot/dts         \ -	-I${srctree}/arch/${ARCH}/boot/dts/include \ +	-I${srctree}/scripts/dtc/include-prefixes  \  	-I${srctree}/drivers/of/testcase-data      \  	-undef -D__DTS__" diff --git a/scripts/parse-maintainers.pl b/scripts/parse-maintainers.pl new file mode 100644 index 000000000000..a0fe34349b24 --- /dev/null +++ b/scripts/parse-maintainers.pl @@ -0,0 +1,77 @@ +#!/usr/bin/perl -w + +use strict; + +my %map; + +# sort comparison function +sub by_category($$) { +    my ($a, $b) = @_; + +    $a = uc $a; +    $b = uc $b; + +    # This always sorts last +    $a =~ s/THE REST/ZZZZZZ/g; +    $b =~ s/THE REST/ZZZZZZ/g; + +    $a cmp $b; +} + +sub alpha_output { +    my $key; +    my $sort_method = \&by_category; +    my $sep = ""; + +    foreach $key (sort $sort_method keys %map) { +        if ($key ne " ") { +            print $sep . $key . "\n"; +            $sep = "\n"; +        } +        print $map{$key}; +    } +} + +sub trim { +    my $s = shift; +    $s =~ s/\s+$//; +    $s =~ s/^\s+//; +    return $s; +} + +sub file_input { +    my $lastline = ""; +    my $case = " "; +    $map{$case} = ""; + +    while (<>) { +        my $line = $_; + +        # Pattern line? +        if ($line =~ m/^([A-Z]):\s*(.*)/) { +            $line = $1 . ":\t" . trim($2) . "\n"; +            if ($lastline eq "") { +                $map{$case} = $map{$case} . $line; +                next; +            } +            $case = trim($lastline); +            exists $map{$case} and die "Header '$case' already exists"; +            $map{$case} = $line; +            $lastline = ""; +            next; +        } + +        if ($case eq " ") { +            $map{$case} = $map{$case} . $lastline; +            $lastline = $line; +            next; +        } +        trim($lastline) eq "" or die ("Odd non-pattern line '$lastline' for '$case'"); +        $lastline = $line; +    } +    $map{$case} = $map{$case} . $lastline; +} + +&file_input; +&alpha_output; +exit(0);  | 
