make openwrt boot on ar9130 (currently no ethernet yet)
[librecmc/librecmc.git] / scripts / metadata.pl
index 007b63ed9febe816ddc52ada44ba32116a9266ec..ce8092497830af264ce91d2324560999e93fdf5a 100755 (executable)
@@ -380,14 +380,14 @@ sub mconf_depends($$) {
                        $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 mconf_depends($package{$depend}->{depends}, 1, $dep);
+
+                               $m = "select";
+                               next if $only_dep;
                        };
                        $flags =~ /@/ or $depend = "PACKAGE_$depend";
                }
@@ -472,7 +472,7 @@ sub print_package_config_category($) {
 
 sub gen_package_config() {
        parse_package_metadata($ARGV[0]) or exit 1;
-       print "menuconfig UCI_PRECONFIG\n\tbool \"Image configuration\"\n";
+       print "menuconfig UCI_PRECONFIG\n\tbool \"Image configuration\"\n" if %preconfig;
        foreach my $preconfig (keys %preconfig) {
                foreach my $cfg (keys %{$preconfig{$preconfig}}) {
                        my $conf = $preconfig{$preconfig}->{$cfg}->{id};