On 2020/03/20 17:41, Jeremie Courreges-Anglas wrote: > >> only rc[N], beta[N], pre[N], and pl[N]. Would it makes sense to add a > >> alpha[N]? We could of course also use EPOCH here. > > > > adding support for alpha[N] would be in suffix_compare in PackageName.pm > > (and from_string), but that would only work (afaik) if the suffix was > > directly near the version, ie 5.13.2alpha3 (not 5.13.2-alpha3). > > I suspect that the lack of support for alpha[N] is intentional, as in > "You should not put alpha-quality software in the ports tree."
Yes, I think so too. > The current situation is that we have ports using alpha releases in the > tree, and I see no reason to arbitrarily draw a line between alpha and > beta releases. > Diff below, not tested much yet. Thoughts? I agree with adding it. It wants to go in /usr/src/regress/usr.sbin/pkg_add/check-name and packages-specs(7) too, and I think anything currently using "alpha" will need an EPOCH bump. > cc'ing espie > > > Index: OpenBSD/PackageName.pm > =================================================================== > RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PackageName.pm,v > retrieving revision 1.53 > diff -u -p -r1.53 PackageName.pm > --- OpenBSD/PackageName.pm 7 Nov 2019 15:35:23 -0000 1.53 > +++ OpenBSD/PackageName.pm 20 Mar 2020 14:48:00 -0000 > @@ -153,7 +153,7 @@ 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|beta|pre|pl)(\d*)$/) { > + if ($o->{deweys}->[-1] =~ m/^(\d+)(rc|alpha|beta|pre|pl)(\d*)$/) { > $o->{deweys}->[-1] = $1; > $o->{suffix} = $2; > $o->{suffix_value} = $3; > @@ -193,10 +193,13 @@ sub suffix_compare > if ($a->{suffix} gt $b->{suffix}) { > return -suffix_compare($b, $a); > } > - # order is '', beta, pre, rc > + # order is '', alpha, beta, pre, rc > # we know that a < b, > if ($a->{suffix} eq '') { > return 1; > + } > + if ($a->{suffix} eq 'alpha') { > + return -1; > } > if ($a->{suffix} eq 'beta') { > return -1; > > > > -- > jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE >