From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Wed, 19 Nov 2008 15:55:24 +0000 (+0000) Subject: Resolve foo-devel dependencies correctly. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=58729b97e6fdd6ece2766a2b6651330c1561387b;p=fedora-mingw.git Resolve foo-devel dependencies correctly. --- diff --git a/smock/smock.pl b/smock/smock.pl index ed32162..d7ebbc5 100755 --- a/smock/smock.pl +++ b/smock/smock.pl @@ -167,10 +167,24 @@ sub is_member_of 0; } +sub dependency_in +{ + my $dep = shift; # eg. dbus-devel + + while ($dep) { + return $dep if is_member_of ($dep, @_); + my $newdep = $dep; + $newdep =~ s/-\w+$//; # eg. dbus-devel -> dbus + last if $newdep eq $dep; + $dep = $newdep; + } + 0; +} + my @names = keys %srpms; foreach my $name (@names) { my @buildrequires = @{$srpms{$name}->{buildrequires}}; - @buildrequires = grep { is_member_of ($_, @names) } @buildrequires; + @buildrequires = grep { $_ = dependency_in ($_, @names) } @buildrequires; $srpms{$name}{buildrequires} = \@buildrequires; }