fix duplicate dependencies
authorFelix Fietkau <nbd@openwrt.org>
Sun, 14 Oct 2007 05:25:50 +0000 (05:25 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 14 Oct 2007 05:25:50 +0000 (05:25 +0000)
SVN-Revision: 9311

scripts/metadata.pl

index 580e29ea0ba02a589ff776ad3cf2241cf9284352..4fa7be0412dba3d86737ab024d01bba6be06e2e8 100755 (executable)
@@ -301,6 +301,8 @@ sub mconf_depends($$) {
        my $depends = shift;
        my $only_dep = shift;
        my $res;
+       my $dep = shift;
+       $dep or $dep = {};
 
        $depends or return;
        my @depends = @$depends;
@@ -321,10 +323,14 @@ sub mconf_depends($$) {
                                # 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);
+                               $package{$depend} and mconf_depends($package{$depend}->{depends}, 1, $dep);
                        };
                        $flags =~ /@/ or $depend = "PACKAGE_$depend";
                }
+               $dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
+       }
+       foreach my $depend (keys %$dep) {
+               my $m = $dep->{$depend};
                $res .= "\t\t$m $depend\n";
        }
        return $res;