On Wed, Jan 6, 2021, at 17:16, Jeremy O'Brien wrote:
> Hi there,
> 
> I'm looking through the pkgtools code to determine how the version 
> comparison logic works, and I came across this block of code at 
> /usr/libdata/perl5/OpenBSD/PackageName.pm:385:
> 
> sub from_string
> {
>         my ($class, $string) = @_;
>         my $o = bless { deweys => [ split(/\./o, $string) ],
>                 suffix => '', suffix_value => 0}, $class;
>         if ($o->{deweys}->[-1] =~ m/^(\d+)(rc|alpha|beta|pre|pl)(\d*)$/) {
>                 $o->{deweys}->[-1] = $1;
>                 $o->{suffix} = $2;
>                 $o->{suffix_value} = $3;
>         }       
>         return $o;      
> }
> 
> From what I understand, this is looking for one of OpenBSD "special" 
> suffixes for a given version part of a package version. This code seems 
> to only match cases where the "special" portion (rc, alpha, beta etc) 
> of the version sits between a required decimal on the left and an 
> optional decimal on the right. Looking through the current package 
> listing, I found this one:
> 
> clementine-1.4.0rc1p0.tgz
> 
> Given the above regex, the rc1 portion of the package name will not be 
> pulled into the suffix, and I believe that (given a comparison where 
> the 1.4.0 portion of the version doesn't change) a future version 
> comparison with this package version will potentially be done 
> alphabetically?
> 
> Is this intentional? Or perhaps I'm missing something here or elsewhere 
> with this code.
> 
> Thank you,
> Jeremy
> 
>

Nevermind; I found where the hole in my logic was: 
OpenBSD::PackageName::version handles the p/v cases. Sorry for the noise!

Reply via email to