Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, Zac Medico <zmedico@g.o>
Subject: [gentoo-dev] [PATCH] python-utils-r1.eclass: support PYTHON_IMPLS_NO_STRICT variable
Date: Tue, 02 May 2017 21:49:38
Message-Id: 20170502214840.10124-1-zmedico@gentoo.org
1 This is intended to be set by the user when using ebuilds that may
2 have unknown implementations in PYTHON_COMPAT. The assumption is
3 that the ebuilds are intended to be used within multiple contexts
4 which can involve revisions of this eclass that support different
5 python implementations.
6 ---
7 eclass/python-utils-r1.eclass | 16 ++++++++++++++++
8 1 file changed, 16 insertions(+)
9
10 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
11 index 66a359e..1846da3 100644
12 --- a/eclass/python-utils-r1.eclass
13 +++ b/eclass/python-utils-r1.eclass
14 @@ -47,6 +47,21 @@ _PYTHON_ALL_IMPLS=(
15 )
16 readonly _PYTHON_ALL_IMPLS
17
18 +# @ECLASS-VARIABLE: PYTHON_IMPLS_NO_STRICT
19 +# @DESCRIPTION:
20 +# Tolerate unknown implementations in PYTHON_COMPAT.
21 +#
22 +# This is intended to be set by the user when using ebuilds that may
23 +# have unknown implementations in PYTHON_COMPAT. The assumption is
24 +# that the ebuilds are intended to be used within multiple contexts
25 +# which can involve revisions of this eclass that support different
26 +# python implementations.
27 +#
28 +# Example:
29 +# @CODE
30 +# PYTHON_IMPLS_NO_STRICT=1
31 +# @CODE
32 +
33 # @FUNCTION: _python_impl_supported
34 # @USAGE: <impl>
35 # @INTERNAL
36 @@ -79,6 +94,7 @@ _python_impl_supported() {
37 fi
38 ;;
39 *)
40 + [[ -n ${PYTHON_IMPLS_NO_STRICT} ]] && return 1
41 die "Invalid implementation in PYTHON_COMPAT: ${impl}"
42 esac
43 }
44 --
45 2.10.2

Replies