- if (defined $pkg{$dep}->{src} && $pkg{$name}->{src} ne $pkg{$dep}->{src}) {
- $hasdeps = 1;
- $line .= " $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;