scripts/metadata.pl: add support for ignoring source packages when generating metadata

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48170
This commit is contained in:
Felix Fietkau 2016-01-10 16:35:16 +00:00
parent da19a09b9e
commit 3d8c8cf3bb
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@ use FindBin;
use lib "$FindBin::Bin"; use lib "$FindBin::Bin";
use strict; use strict;
use metadata; use metadata;
use Getopt::Long;
my %board; my %board;
@ -871,6 +872,7 @@ sub gen_version_filtered_list() {
} }
sub parse_command() { sub parse_command() {
GetOptions("ignore=s", \@ignore);
my $cmd = shift @ARGV; my $cmd = shift @ARGV;
for ($cmd) { for ($cmd) {
/^target_config$/ and return gen_target_config(); /^target_config$/ and return gen_target_config();
@ -895,6 +897,8 @@ Available Commands:
$0 package_licensefull [file] Package license information (full list) $0 package_licensefull [file] Package license information (full list)
$0 version_filter [patchver] [list...] Filter list of version tagged strings $0 version_filter [patchver] [list...] Filter list of version tagged strings
Options:
--ignore <name> Ignore the source package <name>
EOF EOF
} }

View File

@ -2,7 +2,7 @@ package metadata;
use base 'Exporter'; use base 'Exporter';
use strict; use strict;
use warnings; use warnings;
our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline); our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore);
our %package; our %package;
our %preconfig; our %preconfig;
@ -11,6 +11,7 @@ our %category;
our %subdir; our %subdir;
our %features; our %features;
our %overrides; our %overrides;
our @ignore;
sub get_multiline { sub get_multiline {
my $fh = shift; my $fh = shift;
@ -130,6 +131,7 @@ sub parse_package_metadata($) {
my $subdir; my $subdir;
my $src; my $src;
my $override; my $override;
my %ignore = map { $_ => 1 } @ignore;
open FILE, "<$file" or do { open FILE, "<$file" or do {
warn "Cannot open '$file': $!\n"; warn "Cannot open '$file': $!\n";
@ -152,6 +154,7 @@ sub parse_package_metadata($) {
$overrides{$src} = 1; $overrides{$src} = 1;
}; };
next unless $src; next unless $src;
next if $ignore{$src};
/^Package:\s*(.+?)\s*$/ and do { /^Package:\s*(.+?)\s*$/ and do {
undef $feature; undef $feature;
$pkg = {}; $pkg = {};