X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=scripts%2Fmetadata.pl;h=4a05628a54fac1c76ba7ef2a0b2ac330c3e79379;hp=5da5ac48a0734fc36b02aec61bfd6b26b37ed555;hb=2183708c9693c88d0fed75058e0ef51cd4d6bba4;hpb=99bd2a4e33ce4e19a54fad62aff613126068c1df diff --git a/scripts/metadata.pl b/scripts/metadata.pl index 5da5ac48a0..4a05628a54 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -45,6 +45,24 @@ sub parse_target_metadata() { }; /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1; /^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ]; + /^Target-Profile-Description:/ and do { + my $desc; + while (<>) { + last if /^@@/; + $desc .= $_; + } + $profile->{desc} = $desc; + }; + /^Target-Profile-Kconfig:/ and $profile->{kconfig} = 1; + } + foreach my $target (@target) { + @{$target->{profiles}} > 0 or $target->{profiles} = [ + { + id => 'Default', + name => 'Default', + packages => [] + } + ]; } return @target; } @@ -134,7 +152,7 @@ sub gen_target_mk() { PACKAGES:=".join(" ", @{$profile->{packages}})." endef"; $profiles_eval .= " -\$(eval \$(call Profile,$conf\_$profile->{id}))" +\$(eval \$(call AddProfile,$conf\_$profile->{id}))" } print " ifeq (\$(CONFIG_LINUX_$conf),y) @@ -163,6 +181,7 @@ sub target_config_features(@) { /usb/ and $ret .= "\tselect USB_SUPPORT\n"; /atm/ and $ret .= "\tselect ATM_SUPPORT\n"; /pcmcia/ and $ret .= "\tselect PCMCIA_SUPPORT\n"; + /video/ and $ret .= "\tselect VIDEO_SUPPORT\n"; /squashfs/ and $ret .= "\tselect USES_SQUASHFS\n"; /jffs2/ and $ret .= "\tselect USES_JFFS2\n"; /ext2/ and $ret .= "\tselect USES_EXT2\n"; @@ -274,21 +293,19 @@ EOF foreach my $target (@target) { my $profiles = $target->{profiles}; - @$profiles > 0 or $profiles = [ - { - id => 'Default', - name => 'Default', - packages => [] - } - ]; foreach my $profile (@$profiles) { print <{conf}_$profile->{id} bool "$profile->{name}" depends LINUX_$target->{conf} EOF + $profile->{kconfig} and print "\tselect PROFILE_KCONFIG\n"; + my %pkgs; foreach my $pkg (@{$target->{packages}}, @{$profile->{packages}}) { - print "\tselect DEFAULT_$pkg\n"; + $pkgs{$pkg} = 1; + } + foreach my $pkg (keys %pkgs) { + print "\tselect DEFAULT_$pkg\n" unless ($pkg =~ /^-/ or $pkgs{"-$pkg"}); } print "\n"; } @@ -326,6 +343,39 @@ sub package_depends($$) { return $ret; } +sub mconf_depends($$) { + my $depends = shift; + my $only_dep = shift; + my $res; + + $depends or return; + my @depends = @$depends; + foreach my $depend (@depends) { + my $m = "depends"; + $depend =~ s/^([@\+]+)//; + my $flags = $1; + my $vdep; + + if ($vdep = $package{$depend}->{vdepends}) { + $depend = join("||", map { "PACKAGE_".$_ } @$vdep); + } else { + $flags =~ /\+/ and do { + next if $only_dep; + $m = "select"; + + # Menuconfig will not treat 'select FOO' as a real dependency + # thus if FOO depends on other config options, these dependencies + # will not be checked. To fix this, we simply emit all of FOO's + # depends here as well. + $package{$depend} and $res .= mconf_depends($package{$depend}->{depends}, 1); + }; + $flags =~ /@/ or $depend = "PACKAGE_$depend"; + } + $res .= "\t\t$m $depend\n"; + } + return $res; +} + sub print_package_config_category($) { my $cat = shift; my %menus; @@ -379,20 +429,7 @@ sub print_package_config_category($) { foreach my $default (split /\s*,\s*/, $pkg->{default}) { print "\t\tdefault $default\n"; } - foreach my $depend (@{$pkg->{depends}}) { - my $m = "depends"; - $depend =~ s/^([@\+]+)//; - my $flags = $1; - my $vdep; - - if ($vdep = $package{$depend}->{vdepends}) { - $depend = join("||", map { "PACKAGE_".$_ } @$vdep); - } else { - $flags =~ /@/ or $depend = "PACKAGE_$depend"; - $flags =~ /\+/ and $m = "select"; - } - print "\t\t$m $depend\n"; - } + print mconf_depends($pkg->{depends}, 0); print "\t\thelp\n"; print $pkg->{description}; print "\n";