Add die-checks for python.eclass & distutils.eclass variables.
authorMichał Górny <mgorny@gentoo.org>
Sat, 27 Dec 2014 19:31:39 +0000 (19:31 +0000)
committerMichał Górny <mgorny@gentoo.org>
Sat, 27 Dec 2014 19:31:39 +0000 (19:31 +0000)
eclass/ChangeLog
eclass/python-utils-r1.eclass

index 615d9f62f8a5c8e60c7d6934c13a7ec06654bd3a..4dd2977af8bd2f91cec7feccbdb2fae3fa9fa71a 100644 (file)
@@ -1,6 +1,9 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1477 2014/12/27 19:00:10 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1478 2014/12/27 19:31:39 mgorny Exp $
+
+  27 Dec 2014; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass:
+  Add die-checks for python.eclass & distutils.eclass variables.
 
   27 Dec 2014; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass:
   Add die-replacements for distutils.eclass functions, to help finding mistakes
index 173306685231eef8e577b95a17a96d6998e8485f..05c8e15fdeab842bea5515bf4d45c52e2e2561fe 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.68 2014/12/27 18:26:21 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.69 2014/12/27 19:31:39 mgorny Exp $
 
 # @ECLASS: python-utils-r1
 # @MAINTAINER:
@@ -842,6 +842,8 @@ python_wrapper_setup() {
        [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON specified."
 
        if [[ ! -x ${workdir}/bin/python ]]; then
+               _python_check_dead_variables
+
                mkdir -p "${workdir}"/{bin,pkgconfig} || die
 
                # Clean up, in case we were supposed to do a cheap update.
@@ -1168,6 +1170,35 @@ python_export_utf8_locale() {
 
 # -- python.eclass functions --
 
+_python_check_dead_variables() {
+       local v
+
+       for v in PYTHON_DEPEND PYTHON_USE_WITH{,_OR,_OPT} {RESTRICT,SUPPORT}_PYTHON_ABIS
+       do
+               if [[ ${!v} ]]; then
+                       die "${v} is invalid for python-r1 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#Ebuild_head"
+               fi
+       done
+
+       for v in PYTHON_TESTS_RESTRICTED_ABIS PYTHON_EXPORT_PHASE_FUNCTIONS \
+               PYTHON_VERSIONED_{SCRIPTS,EXECUTABLES} PYTHON_NONVERSIONED_EXECUTABLES \
+               PYTHON_TEST_VERBOSITY
+       do
+               if [[ ${!v} ]]; then
+                       die "${v} is invalid for python-r1 suite"
+               fi
+       done
+
+       for v in DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES DISTUTILS_SETUP_FILES \
+               DISTUTILS_GLOBAL_OPTIONS DISTUTILS_SRC_TEST \
+               DISTUTILS_DISABLE_TEST_DEPENDENCY
+       do
+               if [[ ${!v} ]]; then
+                       die "${v} is invalid for distutils-r1"
+               fi
+       done
+}
+
 python_pkg_setup() {
        die "${FUNCNAME}() is invalid for python-r1 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#pkg_setup"
 }