Default to python3 FLAVOR if possible

PyPI projects that already list multiple supported Python versions cause
portgen(1) to generate a flavoured port; of leaving FLAVOR emtpy, opt for
the highest available version.

This makes it use FLAVOR?=python3 insteaf of FLAVOR?= (empty) if any
sypport higher than Python 2 is listed.

Note that PyPI projects listing either only one sypported version or none
at all are not effected by this diff.

OK afresh1 kmos
This commit is contained in:
kn 2020-04-30 23:04:48 +00:00
parent adbc363918
commit 4f01408214

View File

@ -1,4 +1,4 @@
# $OpenBSD: PyPI.pm,v 1.18 2019/12/15 00:18:05 afresh1 Exp $
# $OpenBSD: PyPI.pm,v 1.19 2020/04/30 23:04:48 kn Exp $
#
# Copyright (c) 2015 Giannis Tsaraias <tsg@openbsd.org>
#
@ -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(