Oh, forget what I said about EPOCH, I figured out why is not needed now :-)

--
Sent from a phone, apologies for poor formatting.

On 21 March 2020 02:00:31 Jeremie Courreges-Anglas <[email protected]> wrote:

On Fri, Mar 20 2020, Marc Espie <[email protected]> wrote:
On Fri, Mar 20, 2020 at 05:16:12PM +0000, Stuart Henderson wrote:
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,

Bah, I should have mentioned that the diff was not intended as complete.
Thanks for the pointers, I did not find other places to tweak.

www/faq/ports/guide.html says:

 "* Do not use alpha or beta code when preparing a port. Use the latest
 regular or patch release."

but I don't think it needs changing.

and I think anything currently using "alpha" will
need an EPOCH bump.

Hmm this indeed raises a point...  I'm not sure why they would need an
EPOCH bump.  The packages contents won't change, only the way the
pkg_* tools handle them, right?

There are three affected ports:

ritchie ~$ sqlite3 /usr/local/share/sqlports 'select fullpkgpath, fullpkgname from ports where fullpkgname like "%alpha%";'
archivers/libmspack|libmspack-0.10.1alphav1
lang/squeak/funsqueak|squeak-funsqueak-3.10alpha7
net/py-tlslite-ng,python3|py3-tlslite-ng-0.8.0alpha37p1

- the version of funsqueak hasn't changed since import
- net/py-tlslite-ng has been imported weeks ago and has had no version
 bump
- the last update of archivers/libmspack came with an EPOCH bump so
 I don't see how its version could be considered lower than any
 previous version available in the tree

Even though I can't find a reason for adding/bumping EPOCH in those
ports, I'll do it anyway to resolve any concern, unless I hear
objections.

Definitely wants tests.

The diff below:
- implements the changes as pointed by landry@
- documents "alpha" in packages-specs(7)
- adds "alpha" to the tests in regress/usr.sbin/pkg_add/check-name, as
 suggested by sthen@; ''make pkgnames'' still succeeds

ok?


Index: usr.sbin/pkg_add/OpenBSD/PackageName.pm
===================================================================
RCS file: /d/cvs/src/usr.sbin/pkg_add/OpenBSD/PackageName.pm,v
retrieving revision 1.53
diff -u -p -r1.53 PackageName.pm
--- usr.sbin/pkg_add/OpenBSD/PackageName.pm 7 Nov 2019 15:35:23 -0000 1.53
+++ usr.sbin/pkg_add/OpenBSD/PackageName.pm 21 Mar 2020 01:47:15 -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;
Index: regress/usr.sbin/pkg_add/check-name
===================================================================
RCS file: /d/cvs/src/regress/usr.sbin/pkg_add/check-name,v
retrieving revision 1.11
diff -u -p -r1.11 check-name
--- regress/usr.sbin/pkg_add/check-name 27 Jan 2010 15:41:58 -0000 1.11
+++ regress/usr.sbin/pkg_add/check-name 21 Mar 2020 01:47:15 -0000
@@ -119,5 +119,5 @@ ok(check_list(["correct order is pNvM"],
 "mixed up vp");
ok(check_list([], check_name("pkgname-1.0p0v0")), "correct name");

-ok(check_order(qw(speex-1.2beta3 speex-1.2rc1 speex-1.2 speex-1.2pl1
-    speex-1.3beta1)), 'check order');
+ok(check_order(qw(speex-1.2alpha3 speex-1.2beta3 speex-1.2rc1 speex-1.2
+    speex-1.2pl1 speex-1.3beta1)), 'check order');
Index: share/man/man7/packages-specs.7
===================================================================
RCS file: /d/cvs/src/share/man/man7/packages-specs.7,v
retrieving revision 1.25
diff -u -p -r1.25 packages-specs.7
--- share/man/man7/packages-specs.7 27 Oct 2014 22:45:30 -0000 1.25
+++ share/man/man7/packages-specs.7 21 Mar 2020 01:47:15 -0000
@@ -109,6 +109,7 @@ Other parts are compared alphabetically.
.It
The last part may contain an extra suffix matching
.Ar rc[N] ,
+.Ar alpha[N] ,
.Ar beta[N] ,
.Ar pre[N] ,
or
@@ -118,12 +119,14 @@ with
an optional number.
These correspond to traditional notations for
.Sq release candidate ,
+.Sq alpha version ,
.Sq beta version ,
.Sq pre-release ,
.Sq patch-level ,
and are ordered accordingly, e.g.,
-.Ar beta
-is oldest,
+.Ar alpha
+is oldest, then
+.Ar beta ,
.Ar rc
and
.Ar pre
@@ -137,6 +140,8 @@ then normal version, and finally
"foo-1.001" is older than "foo-1.002", which in turns is older than "foo-1.0010"
.It
"foo-1.0rc2" is not comparable to "foo-1.0pre3"
+.It
+"bar-1.0alpha5" is older than "bar-1.0beta3"
.It
"bar-1.0beta3" is older than "bar-1.0rc1"
.It


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Reply via email to