Author: nbd
Date: 2016-01-10 17:35:16 +0100 (Sun, 10 Jan 2016)
New Revision: 48170

Modified:
   trunk/scripts/metadata.pl
   trunk/scripts/metadata.pm
Log:
scripts/metadata.pl: add support for ignoring source packages when generating 
metadata

Signed-off-by: Felix Fietkau <[email protected]>

Modified: trunk/scripts/metadata.pl
===================================================================
--- trunk/scripts/metadata.pl   2016-01-10 11:39:19 UTC (rev 48169)
+++ trunk/scripts/metadata.pl   2016-01-10 16:35:16 UTC (rev 48170)
@@ -3,6 +3,7 @@
 use lib "$FindBin::Bin";
 use strict;
 use metadata;
+use Getopt::Long;
 
 my %board;
 
@@ -871,6 +872,7 @@
 }
 
 sub parse_command() {
+       GetOptions("ignore=s", \@ignore);
        my $cmd = shift @ARGV;
        for ($cmd) {
                /^target_config$/ and return gen_target_config();
@@ -895,6 +897,8 @@
        $0 package_licensefull [file]           Package license information 
(full list)
        $0 version_filter [patchver] [list...]  Filter list of version tagged 
strings
 
+Options:
+       --ignore <name>                         Ignore the source package <name>
 EOF
 }
 

Modified: trunk/scripts/metadata.pm
===================================================================
--- trunk/scripts/metadata.pm   2016-01-10 11:39:19 UTC (rev 48169)
+++ trunk/scripts/metadata.pm   2016-01-10 16:35:16 UTC (rev 48170)
@@ -2,7 +2,7 @@
 use base 'Exporter';
 use strict;
 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 %preconfig;
@@ -11,6 +11,7 @@
 our %subdir;
 our %features;
 our %overrides;
+our @ignore;
 
 sub get_multiline {
        my $fh = shift;
@@ -130,6 +131,7 @@
        my $subdir;
        my $src;
        my $override;
+       my %ignore = map { $_ => 1 } @ignore;
 
        open FILE, "<$file" or do {
                warn "Cannot open '$file': $!\n";
@@ -152,6 +154,7 @@
                        $overrides{$src} = 1;
                };
                next unless $src;
+               next if $ignore{$src};
                /^Package:\s*(.+?)\s*$/ and do {
                        undef $feature;
                        $pkg = {};
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to