Aaron Bieber writes:
> Andrew Hewus Fresh writes:
>
>> On Tue, Jan 26, 2021 at 05:23:30PM -0700, Aaron Bieber wrote:
>>> Hi,
>>>
>>> Recently a program was found that caused breakage in 'portgen go'. The
>>> breakage was two fold:
>>>
>>> 1) https://proxy.golang.org/qvl.io/promplot/@latest returns unexpected
>>> results. This caused portgen to bomb out.
>>> 2) Even it 1) had worked, the logic in 'get_ver_info' was broken and it
>>> picked the wrong version.
>>>
>>> This diff changes things so we first try to get our version from
>>> '/@latest'. If that fails, we call `get_ver_info` which pulls down the
>>> full list of versions from the '/@v/list' endpoint.
>>>
>>> Thanks to afresh1 for showing me the neat '//=' perl trick!
>>>
>>> Tested with:
>>> portgen go qvl.io/promplot
>>>
>>> as well as a number of other ports.
>>>
>>> OK? Cluesticks?
>>>
>>
>> This seems OK to me, a couple of comments though, but it's up to you
>> whether you change anything.
>>
>>
>>> diff 6a862af059a42a1899fe9a62461b2acfc0f8eedc /usr/ports
>>> blob - 89f2c7297409ef9d54fd1bdde73cf1829c742ff3
>>> file + infrastructure/lib/OpenBSD/PortGen/Port/Go.pm
>>> --- infrastructure/lib/OpenBSD/PortGen/Port/Go.pm
>>> +++ infrastructure/lib/OpenBSD/PortGen/Port/Go.pm
>>> @@ -67,12 +67,9 @@ sub _go_determine_name
>>> # Some modules end in "v1" or "v2", if we find one of these, we need
>>> # to set PKGNAME to something up a level
>>> my ( $self, $module ) = @_;
>>> - my $json = $self->get_json( $self->_go_mod_normalize($module) . '/@latest' );
>>>
>>> - if ($json->{Version} =~ m/incompatible/) {
>>> - my $msg = "${module} $json->{Version} is incompatible with Go modules.";
>>> - croak $msg;
>>> - }
>>
>> Do you still need to check for "incompatible" someplace?
>
> As mentioned in irc - this is leftover and we don't actually hit the
> condition anyway.
>>
>>
>>> + my $json = eval { $self->get_json( $self->_go_mod_normalize($module) . '/@latest' ) };
>>
>> Should this eval'd check for `@latest` be in `get_ver_info`?
>> If not, why not?
>>
Here is a version that moves all the version checks into
get_ver_info. Really it just removes the duplicate I had >.>
No comments:
Post a Comment