Fix parsing of password option; set timeout for writing.
[openwrt/openwrt.git] / scripts / metadata.pl
index 43e5ccc6d0ea20caba880e7f855f84d9e946bb1e..da29fdd895c26d86cac0f2e4b608886428d46bdc 100755 (executable)
@@ -398,6 +398,7 @@ sub mconf_depends {
                        $depend = $2;
                }
                next if $seen->{$depend};
+               next if $package{$depend} and $package{$depend}->{buildonly};
                $seen->{$depend} = 1;
                if ($vdep = $package{$depend}->{vdepends}) {
                        $depend = join("||", map { "PACKAGE_".$_ } @$vdep);
@@ -442,6 +443,7 @@ sub print_package_config_category($) {
 
        foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) {
                foreach my $pkg (@{$spkg{$spkg}}) {
+                       next if $pkg->{buildonly};
                        my $menu = $pkg->{submenu};
                        if ($menu) {
                                $menu_dep{$menu} or $menu_dep{$menu} = $pkg->{submenudep};
@@ -543,6 +545,7 @@ sub gen_package_mk() {
                        $config = "\$(CONFIG_PACKAGE_$name)"
                }
                if ($config) {
+                       $pkg->{buildonly} and $config = "";
                        print "package-$config += $pkg->{subdir}$pkg->{src}\n";
                        $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
                }
@@ -560,7 +563,7 @@ sub gen_package_mk() {
                }
 
                my $hasdeps = 0;
-               my $depline = "";
+               my %deplines;
                foreach my $deps (@srcdeps) {
                        my $idx;
                        my $condition;
@@ -588,9 +591,10 @@ sub gen_package_mk() {
                                }
                                undef $idx if $idx =~ /^(kernel)|(base-files)$/;
                                if ($idx) {
+                                       my $depline;
                                        next if $pkg->{src} eq $pkg_dep->{src};
                                        next if $dep{$pkg->{src}."->".$idx};
-                                       next if $dep{$pkg->{src}."->($dep)".$idx};
+                                       next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
                                        my $depstr;
 
                                        if ($pkg_dep->{vdepends}) {
@@ -602,16 +606,20 @@ sub gen_package_mk() {
                                        }
                                        if ($condition) {
                                                if ($condition =~ /^!(.+)/) {
-                                                       $depline .= " \$(if \$(CONFIG_$1),,$depstr)";
+                                                       $depline = "\$(if \$(CONFIG_$1),,$depstr)";
                                                } else {
-                                                       $depline .= " \$(if \$(CONFIG_$condition),$depstr)";
+                                                       $depline = "\$(if \$(CONFIG_$condition),$depstr)";
                                                }
                                        } else {
-                                               $depline .= " $depstr";
+                                               $depline = $depstr;
+                                       }
+                                       if ($depline) {
+                                               $deplines{$idx.$dep} = $depline;
                                        }
                                }
                        }
                }
+               my $depline = join(" ", values %deplines);
                if ($depline) {
                        $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n";
                }