Merge pull request #11927 from clintongormley/license_check_usage

Build: If SHA files have changed, explain how to update them in the license check exception
This commit is contained in:
Clinton Gormley 2015-06-30 11:29:48 +02:00
commit 58d6a6b144
1 changed files with 16 additions and 1 deletions

View File

@ -28,18 +28,22 @@ sub check_shas_and_licenses {
my %licenses = get_files_with('LICENSE'); my %licenses = get_files_with('LICENSE');
my %notices = get_files_with('NOTICE'); my %notices = get_files_with('NOTICE');
my $error = 0; my $error = 0;
my $sha_error = 0;
for my $jar ( sort keys %new ) { for my $jar ( sort keys %new ) {
my $old_sha = delete $old{$jar}; my $old_sha = delete $old{$jar};
unless ($old_sha) { unless ($old_sha) {
say STDERR "$jar: SHA is missing"; say STDERR "$jar: SHA is missing";
$error++; $error++;
$sha_error++;
next; next;
} }
unless ( $old_sha eq $new{$jar} ) { unless ( $old_sha eq $new{$jar} ) {
say STDERR "$jar: SHA has changed"; say STDERR "$jar: SHA has changed";
$error++; $error++;
$sha_error++;
next; next;
} }
@ -67,6 +71,7 @@ sub check_shas_and_licenses {
unless ($license_found) { unless ($license_found) {
say STDERR "$jar: LICENSE is missing"; say STDERR "$jar: LICENSE is missing";
$error++; $error++;
$sha_error++;
} }
unless ($notice_found) { unless ($notice_found) {
say STDERR "$jar: NOTICE is missing"; say STDERR "$jar: NOTICE is missing";
@ -91,6 +96,16 @@ sub check_shas_and_licenses {
sort @unused_notices; sort @unused_notices;
} }
if ($sha_error) {
say STDERR <<"SHAS"
You can update the SHA files by running:
$0 --update core
SHAS
}
exit $error; exit $error;
} }