Implement support for --test option.

At the moment, there's no package with Type == firmware in the archive,
so --test lets us toy without that filter, finding a bunch of packages.
This commit is contained in:
Cyril Brulebois 2021-07-25 07:16:56 +02:00
parent 18e27f6e08
commit 9d570ad032
1 changed files with 11 additions and 2 deletions

View File

@ -21,9 +21,14 @@ use File::Slurp;
use Getopt::Long;
use YAML::XS;
# XXX: Drop support for --test once we have the required metadata in
# the archive.
my $output_dir = '.';
my $test;
my $verbose;
GetOptions( "output-dir=s" => \$output_dir,
"test" => \$test,
"verbose" => \$verbose )
or die "Error in command line arguments";
@ -52,8 +57,12 @@ sub process_components {
}
foreach my $array (Load $content) {
next if not defined $array->{Type};
next if $array->{Type} ne 'firmware';
# XXX: Drop the condition once we have the required metadata
# in the archive.
if (! $test) {
next if not defined $array->{Type};
next if $array->{Type} ne 'firmware';
}
next if not defined $array->{Provides};
next if not defined $array->{Provides}->{modaliases};