New ports should not use Python 3.
PyPI projects that already list multiple supported Python versions cause
portgen(1) to generate a flavored port, but instead of leaving FLAVOR
empty it should opt for the highest available version.
This makes it use FLAVOR?=python3 instead of FLAVOR?= (empty) if
any support higher than Python 2 is listed.
Feedback? OK?
Please note that PyPI projects listing either only one support version
or none at all at not effected by this diff.
Index: infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm
===================================================================
RCS file: /cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm,v
retrieving revision 1.18
diff -u -p -r1.18 PyPI.pm
--- infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm 15 Dec 2019 00:18:05
-0000 1.18
+++ infrastructure/lib/OpenBSD/PortGen/Port/PyPI.pm 20 Apr 2020 16:31:22
-0000
@@ -118,7 +118,7 @@ sub fill_in_makefile
shift @versions; # remove default, lowest
$self->{reset_values}{MODPY_VERSION} = 1;
$self->set_other( 'FLAVORS', "python$_" ) for @versions;
- $self->set_other( 'FLAVOR', '' );
+ $self->set_other( 'FLAVOR', "python$versions[-1]" );
} elsif ( @versions && $versions[0] != 2 ) {
$self->{reset_values}{$_} = 1 for qw( FLAVORS FLAVOR );
$self->set_other(