X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=scripts%2Fgen_deps.pl;h=0983186f8614f84d2d3e0f94e076debf2c78980e;hb=4c9d7a5f27c9b6cf0e7e3ccec87025b7131096ac;hp=40153bde3d10f6d96c01df1a74e145740237303d;hpb=ae7dab366c205a5358f66ba0d3d678566ccc3f29;p=openwrt-10.03%2F.git diff --git a/scripts/gen_deps.pl b/scripts/gen_deps.pl index 40153bde3..0983186f8 100755 --- a/scripts/gen_deps.pl +++ b/scripts/gen_deps.pl @@ -5,6 +5,7 @@ my $name; my $src; my $makefile; my %pkg; +my %dep; my $line; while ($line = <>) { @@ -19,8 +20,12 @@ while ($line = <>) { $pkg{$name}->{src} = $src; }; $line =~ /^(Build-)?Depends: \s*(.+)\s*$/ and do { - my @dep = split /,\s*/, $2; - $pkg{$name}->{depends} = \@dep; + $pkg{$name}->{depends} ||= []; + foreach my $v (split /\s+/, $2) { + next if $v =~ /^@/; + $v =~ s/^\+//; + push @{$pkg{$name}->{depends}}, $v; + } }; } @@ -32,8 +37,16 @@ foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) { my $hasdeps = 0; my $depline = ""; foreach my $dep (@{$pkg{$name}->{depends}}) { - if (defined $pkg{$dep}->{src} && $pkg{$name}->{src} ne $pkg{$dep}->{src}) { - $depline .= " $pkg{$dep}->{src}-compile"; + my $idx; + if (defined $pkg{$dep}->{src}) { + ($pkg{$name}->{src} ne $pkg{$dep}->{src}) and $idx = $pkg{$dep}->{src}; + } elsif (defined $pkg{$dep}) { + $idx = $dep; + } + if ($idx) { + next if $dep{$pkg{$name}->{src}."->".$idx}; + $depline .= " $idx\-compile"; + $dep{$pkg{$name}->{src}."->".$idx} = 1; } } if ($depline ne "") {