diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2014-10-09 10:08:56 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-10-09 17:36:39 -0500 |
commit | dcba92797f981bc9d6969b5def25ca246a172859 (patch) | |
tree | c7cc119e1c47c4c72b3d7b4277d11c0c005f5e95 /src/build | |
parent | 8cf61f358fb8c81bf6766c66909462a25d61981b (diff) | |
download | talos-hostboot-dcba92797f981bc9d6969b5def25ca246a172859.tar.gz talos-hostboot-dcba92797f981bc9d6969b5def25ca246a172859.zip |
Prevent duplicate contributors in the copyrightblock
Git merge was causing extra contributors to be added to the
copyright block. This change fixes up any duplicates.
Change-Id: If70eb791a3dda8cc820656e0e761f6758736b294
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13906
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-x | src/build/tools/addCopyright.pl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/build/tools/addCopyright.pl b/src/build/tools/addCopyright.pl index 8c6e01d3e..04775dbac 100755 --- a/src/build/tools/addCopyright.pl +++ b/src/build/tools/addCopyright.pl @@ -417,7 +417,6 @@ sub update( $$ ) if ( $opt_debug ) { print STDERR __LINE__, ": fill in new copyright block...\n"; } fillinEmptyCopyrightBlock( $filename, $filetype ); - } ## return OK by default. @@ -656,7 +655,8 @@ sub checkCopyrightBlock( $$ ) ## split into lines and check for specific things ## $Source: src/usr/initservice/istepdispatcher/istepdispatcher.H $ - my %blockFileContributors = (); + my %blockFileContributorsHash = (); + my $numBlockEntries = 0; for ( split /^/, $block ) { chomp( $_ ); @@ -706,7 +706,8 @@ sub checkCopyrightBlock( $$ ) # remove trailing and leading whitespace $_ =~ s/^\s+|\s+$//g; # add contributor to hash - $blockFileContributors{$_} = 1; + $blockFileContributorsHash{$_} = 1; + $numBlockEntries++; } } ## endfor @@ -716,7 +717,7 @@ sub checkCopyrightBlock( $$ ) # Make sure no extra or missing contributors by checking if the current # contributor block matches the git log history if ( (scalar keys %fileContributors) != - (scalar keys %blockFileContributors) ) + ($numBlockEntries) ) { print STDOUT "WARNING: Extra or missing file contributors\n"; return RC_BAD_CONTRIBUTORS_BLOCK; @@ -726,7 +727,7 @@ sub checkCopyrightBlock( $$ ) while ( my ($key, $value) = each(%fileContributors) ) { # Block does not match file contributors - if ( !exists($blockFileContributors{$key}) ) + if ( !exists($blockFileContributorsHash{$key}) ) { print STDOUT "WARNING: File contributors section not correct\n"; return RC_BAD_CONTRIBUTORS_BLOCK; @@ -1075,7 +1076,7 @@ sub fillinEmptyCopyrightBlock( $$ ) # Get copyright contributors based on hash so no duplicates my %fileContributors = getFileContributors( $filename ); my $copyright_Contributors = ""; - while ( my ($key, $value) = each(%fileContributors) ) + foreach my $key (sort keys %fileContributors) { $copyright_Contributors .= "[+] ".$key."\n"; } @@ -1186,6 +1187,7 @@ EOF } } + ####################################### ## Gets file contirbutors based on git log of a file ## |