python-utils-r1.eclass: support PYTHON_COMPAT_NO_STRICT variable
authorZac Medico <zmedico@gentoo.org>
Tue, 2 May 2017 21:48:40 +0000 (14:48 -0700)
committerMichał Górny <mgorny@gentoo.org>
Tue, 16 May 2017 17:18:03 +0000 (19:18 +0200)
This is intended to be set by the user when using ebuilds that may
have unknown implementations in PYTHON_COMPAT. The assumption is
that the ebuilds are intended to be used within multiple contexts
which can involve revisions of this eclass that support different
Python implementations.

eclass/python-utils-r1.eclass

index 1a9f6ed171de4bd6215be85d3551f6f131ea7d0b..c1349ff277b0b0b083c04cd5ca55cfe25b56f5b6 100644 (file)
@@ -47,6 +47,18 @@ _PYTHON_ALL_IMPLS=(
 )
 readonly _PYTHON_ALL_IMPLS
 
+# @ECLASS-VARIABLE: PYTHON_COMPAT_NO_STRICT
+# @INTERNAL
+# @DESCRIPTION:
+# Set to a non-empty value in order to make eclass tolerate (ignore)
+# unknown implementations in PYTHON_COMPAT.
+#
+# This is intended to be set by the user when using ebuilds that may
+# have unknown (newer) implementations in PYTHON_COMPAT. The assumption
+# is that the ebuilds are intended to be used within multiple contexts
+# which can involve revisions of this eclass that support a different
+# set of Python implementations.
+
 # @FUNCTION: _python_impl_supported
 # @USAGE: <impl>
 # @INTERNAL
@@ -79,6 +91,7 @@ _python_impl_supported() {
                        fi
                        ;;
                *)
+                       [[ ${PYTHON_COMPAT_NO_STRICT} ]] && return 1
                        die "Invalid implementation in PYTHON_COMPAT: ${impl}"
        esac
 }