On Fri, Apr 17, 2020 at 10:18:38PM +0200, Thomas L. wrote: > Hi, > > as noted yesterday, portgen fails to find ruby dependencies which are > already ported. This is because module_in_ports() searches the pkgstem, > which contains the ruby version. Patch below lets portgen search for > the right prefixes and portgen of the activerecord gem works correctly > with this. Note that the case of just a "ruby-" prefix (which only > happens with the ruby-shims package) is already covered by the search > with ecosystem_prefix in name_new_port in Port.pm. > > Kind regards,
Try this patch with `portgen ruby activesupport` and you'll see that it it still doesn't find it. You would have to add the same logic in the name_new_ports sub as the parent module looks for the *current* port being ported. I also don't really like hard-coding the list of possible ruby flavors here in PortGen as nobody will remember to update them. I'm OK doing it for "py" vs "py3" because a major Python version number change is a big deal, a new Ruby 2.8 is significantly less so. If we can find a nice way to grab this list from ruby.port.mk, I would go for a patch to fix the places that need it to use that. > Thomas > > diff --git infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm > infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm > index 1703fba5b89..85a5b11c513 100644 > --- infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm > +++ infrastructure/lib/OpenBSD/PortGen/Port/Ruby.pm > @@ -97,7 +97,9 @@ sub get_deps > > next if $self->is_standard_module($name); > > - my $port = module_in_ports( $name, 'ruby-' ) > + my $port = module_in_ports( $name, 'ruby27-' ) > + || module_in_ports( $name, 'ruby26-' ) > + || module_in_ports( $name, 'ruby25-' ) > || $self->name_new_port($name); > > $req =~ s/ //g; > -- andrew - http://afresh1.com Hey! It compiles! Ship it!
