diff options
author | Charles Baylis <charles.baylis@linaro.org> | 2017-03-23 10:57:56 +0000 |
---|---|---|
committer | Charles Baylis <charles.baylis@linaro.org> | 2017-03-27 18:52:54 +0000 |
commit | f07f7b7043e572b6384b4afeeb63995389930484 (patch) | |
tree | c2940c1c8e203ccc7d8c487001335d0e377f0390 | |
parent | 290458fe90a9c63f0379a4c2f32e912053212aa4 (diff) |
validate-manifest.pl: Support generic manifests.
Currently, validate-manifest.pl simultaneous validates both
the syntax of the manifest file, and that its contents match
the expected output from Abe when it builds a full gcc toolchain.
This can be useful for partial validation of manifests which
arise from partial builds (eg abe.sh --build gcc), or from
old format manifests which don't contain components which
are now required.
Change-Id: I735a1038eac94c9d30c9ab99361172555db6cfb7
-rwxr-xr-x | validate-manifest.pl | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/validate-manifest.pl b/validate-manifest.pl index 1315f3e..1d7e3ea 100755 --- a/validate-manifest.pl +++ b/validate-manifest.pl @@ -6,29 +6,34 @@ use warnings; use strict; my ($opt_online, $opt_quiet, $opt_release, $opt_output_normalized); -my ($opt_verbose); +my ($opt_verbose, $opt_manifest_type); my (@file_args); +# default to checking that manifest has all expected components +$opt_manifest_type = 'gcc'; + # default to online checking of md5sums in .asc files, but don't download # full tarballs to check $opt_online = 1; while (@ARGV) { - my $opt = $ARGV[0]; - if ($opt eq "--online") { shift; $opt_online = 1; next; } - if ($opt eq "--online-full") { shift; $opt_online = 2; next; } - if ($opt =~ /^--no[_-]?online$/) { shift; $opt_online = 0; next; } - if ($opt eq "--quiet") { shift; $opt_quiet = 1; next; } - if ($opt eq "--verbose") { shift; $opt_verbose = 1; next; } - if ($opt eq "--release") { shift; $opt_release = 1; next; } - if ($opt =~ /^--output-normalized(=(.*))?$/) { shift; $opt_output_normalized = $2 // shift; next; } + my $opt = shift; + if ($opt eq "--online") { $opt_online = 1; next; } + if ($opt eq "--online-full") { $opt_online = 2; next; } + if ($opt =~ /^--no[_-]?online$/) { $opt_online = 0; next; } + if ($opt eq "--quiet") { $opt_quiet = 1; next; } + if ($opt eq "--verbose") { $opt_verbose = 1; next; } + if ($opt eq "--release") { $opt_release = 1; next; } + if ($opt =~ /^--output-normalized(=(.*))?$/) { $opt_output_normalized = $2 // shift; next; } + if ($opt =~ /^--type(=(.*))?$/) { $opt_manifest_type = $2 // shift; next; } if ($opt =~ /^--/) { die "Unrecognised option $opt"; } # Other arguments are manifest files for validation. - push @file_args, shift; + push @file_args, $opt; } die "Syntax..." unless $#file_args > -1; +die "Manifest type '$opt_manifest_type' not supported" unless $opt_manifest_type=~/^(gcc|generic)$/; if (defined $opt_output_normalized && $#file_args != 0) { @@ -162,7 +167,7 @@ foreach my $file (@file_args) die ("manifest parsing of $file failed") unless defined $manifest; check_manifest_version($manifest); - check_components_list($manifest); + check_components_list($manifest) if $opt_manifest_type eq "gcc"; check_all_flags($manifest); check_all_components($manifest); check_url_locations($manifest) if $opt_release; |