Moving the logic back to get_deps allows a less hacky approach, since
the Makefile is already created. I like this much better.

diff --git infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm 
infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm
index 1703fba5b89..e4ed3d9d6a4 100644
--- infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm
+++ infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm
@@ -21,6 +21,8 @@ use warnings;

 use parent 'OpenBSD::PortGen::Port';

+use List::Util qw( reduce );
+
 use OpenBSD::PortGen::Dependency;
 use OpenBSD::PortGen::Utils qw( module_in_ports );

@@ -97,8 +99,9 @@ sub get_deps

                next if $self->is_standard_module($name);

-               my $port = module_in_ports( $name, 'ruby-' )
-                   || $self->name_new_port($name);
+               my @flavors = split ' ', $self->make_show('FLAVORS');
+               my $port = reduce { $a || module_in_ports($name, "$b-") } 0, 
@flavors;
+               $port = $self->name_new_port($name) unless $port;

                $req =~ s/ //g;

Reply via email to