X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/d29153dc010840afa45e70ced91c5e558fca6bb6..10208a7eb1ffcc3e428a854841a81a295e541a9f:/scripts/metadata.pl diff --git a/scripts/metadata.pl b/scripts/metadata.pl index f3d6e9df2..580e29ea0 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -25,7 +25,9 @@ sub parse_target_metadata() { $target = { id => $1, conf => confstr($1), - profiles => [] + profiles => [], + features => [], + depends => [] }; push @target, $target; }; @@ -38,6 +40,7 @@ sub parse_target_metadata() { /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1; /^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1; /^Target-Features:\s*(.+)\s*$/ and $target->{features} = [ split(/\s+/, $1) ]; + /^Target-Depends:\s*(.+)\s*$/ and $target->{depends} = [ split(/\s+/, $1) ]; /^Target-Description:/ and $target->{desc} = get_multiline(*FILE); /^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1; /^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1; @@ -189,6 +192,20 @@ EOF if ($target->{id} ne $target->{board}) { print "\tselect TARGET_".$target->{boardconf}."\n"; } + foreach my $dep (@{$target->{depends}}) { + my $mode = "depends"; + my $flags; + my $name; + + $dep =~ /^([@\+\-]+)(.+)$/; + $flags = $1; + $name = $2; + + $flags =~ /-/ and $mode = "deselect"; + $flags =~ /\+/ and $mode = "select"; + $flags =~ /@/ and print "\t$mode $name\n"; + } + print "$features$help\n\n" } @@ -361,7 +378,7 @@ sub print_package_config_category($) { print "\t"; $pkg->{menu} and print "menu"; print "config PACKAGE_".$pkg->{name}."\n"; - print "\t\ttristate \"$title\"\n"; + print "\t\t".($pkg->{tristate} ? 'tristate' : 'bool')." \"$title\"\n"; print "\t\tdefault y if DEFAULT_".$pkg->{name}."\n"; foreach my $default (split /\s*,\s*/, $pkg->{default}) { print "\t\tdefault $default\n";