summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/python-r1.eclass217
2 files changed, 5 insertions, 217 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index c0a012ee4e45..ca5959b020de 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1727 2015/07/25 10:07:36 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1728 2015/07/27 16:31:01 floppym Exp $
+
+ 27 Jul 2015; Mike Gilbert <floppym@gentoo.org> python-r1.eclass:
+ Drop the USE_PYTHON warning.
25 Jul 2015; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass:
Add missing ||die to "rm -f" calls, i.e. in case we do not have permission to
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index cdc6097451b8..326c682fb50f 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.92 2015/07/04 15:26:17 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.93 2015/07/27 16:31:01 floppym Exp $
# @ECLASS: python-r1
# @MAINTAINER:
@@ -430,220 +430,6 @@ python_copy_sources() {
multibuild_copy_sources
}
-# @FUNCTION: _python_check_USE_PYTHON
-# @INTERNAL
-# @DESCRIPTION:
-# Check whether USE_PYTHON and PYTHON_TARGETS are in sync. Output
-# warnings if they are not.
-_python_check_USE_PYTHON() {
- debug-print-function ${FUNCNAME} "${@}"
-
- if [[ ! ${_PYTHON_USE_PYTHON_CHECKED} ]]; then
- _PYTHON_USE_PYTHON_CHECKED=1
-
- # python-exec has profile-forced flags.
- if [[ ${CATEGORY}/${PN} == dev-lang/python-exec ]]; then
- return
- fi
-
- _try_eselect() {
- # The eselect solution will work only with one py2 & py3.
-
- local impl py2 py3 dis_py2 dis_py3
- for impl in "${PYTHON_COMPAT[@]}"; do
- _python_impl_supported "${impl}" || continue
-
- if use "python_targets_${impl}"; then
- case "${impl}" in
- python2_*)
- if [[ ${py2+1} ]]; then
- debug-print "${FUNCNAME}: -> more than one py2: ${py2} ${impl}"
- return 1
- fi
- py2=${impl/_/.}
- ;;
- python3_4)
- debug-print "${FUNCNAME}: python3.4 found, not using eselect"
- return 1
- ;;
- python3_*)
- if [[ ${py3+1} ]]; then
- debug-print "${FUNCNAME}: -> more than one py3: ${py3} ${impl}"
- return 1
- fi
- py3=${impl/_/.}
- ;;
- *)
- return 1
- ;;
- esac
- else
- case "${impl}" in
- python2_*)
- dis_py2=1
- ;;
- python3_*)
- dis_py3=1
- ;;
- esac
- fi
- done
-
- # The eselect solution won't work if the disabled Python version
- # is installed.
- if [[ ! ${py2+1} && ${dis_py2} ]]; then
- debug-print "${FUNCNAME}: -> all py2 versions disabled"
- if ! has python2_7 "${PYTHON_COMPAT[@]}"; then
- debug-print "${FUNCNAME}: ---> package does not support 2.7"
- return 0
- fi
- if has_version '=dev-lang/python-2*'; then
- debug-print "${FUNCNAME}: ---> but =python-2* installed!"
- return 1
- fi
- fi
- if [[ ! ${py3+1} && ${dis_py3} ]]; then
- debug-print "${FUNCNAME}: -> all py3 versions disabled"
- if ! has python3_2 "${PYTHON_COMPAT[@]}"; then
- debug-print "${FUNCNAME}: ---> package does not support 3.2"
- return 0
- fi
- if has_version '=dev-lang/python-3*'; then
- debug-print "${FUNCNAME}: ---> but =python-3* installed!"
- return 1
- fi
- fi
-
- local warned
-
- # Now check whether the correct implementations are active.
- if [[ ${py2+1} ]]; then
- local sel_py2=$(eselect python show --python2)
-
- debug-print "${FUNCNAME}: -> py2 built: ${py2}, active: ${sel_py2}"
- if [[ ${py2} != ${sel_py2} ]]; then
- ewarn "Building package for ${py2} only while ${sel_py2} is active."
- ewarn "Please consider switching the active Python 2 interpreter:"
- ewarn
- ewarn " eselect python set --python2 ${py2}"
- warned=1
- fi
- fi
-
-
- if [[ ${py3+1} ]]; then
- local sel_py3=$(eselect python show --python3)
-
- debug-print "${FUNCNAME}: -> py3 built: ${py3}, active: ${sel_py3}"
- if [[ ${py3} != ${sel_py3} ]]; then
- [[ ${warned} ]] && ewarn
- ewarn "Building package for ${py3} only while ${sel_py3} is active."
- ewarn "Please consider switching the active Python 3 interpreter:"
- ewarn
- ewarn " eselect python set --python3 ${py3}"
- warned=1
- fi
- fi
-
- if [[ ${warned} ]]; then
- ewarn
- ewarn "Please note that after switching the active Python interpreter,"
- ewarn "you may need to run 'python-updater' to rebuild affected packages."
- ewarn
- ewarn "For more information on PYTHON_TARGETS and python.eclass"
- ewarn "compatibility, please see the relevant Wiki article [1]."
- ewarn
- ewarn "[1] https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS"
- fi
- }
-
- # If user has no USE_PYTHON, try to avoid it.
- if [[ ! ${USE_PYTHON} ]]; then
- debug-print "${FUNCNAME}: trying eselect solution ..."
- _try_eselect && return
- fi
-
- debug-print "${FUNCNAME}: trying USE_PYTHON solution ..."
- debug-print "${FUNCNAME}: -> USE_PYTHON=${USE_PYTHON}"
-
- local impl old=${USE_PYTHON} new=() removed=()
-
- for impl in "${PYTHON_COMPAT[@]}"; do
- _python_impl_supported "${impl}" || continue
-
- local abi
- case "${impl}" in
- pypy|pypy3|python3_4)
- # unsupported in python.eclass
- continue
- ;;
- python*)
- abi=${impl#python}
- ;;
- jython*)
- abi=${impl#jython}-jython
- ;;
- *)
- die "Unexpected Python implementation: ${impl}"
- ;;
- esac
- abi=${abi/_/.}
-
- has "${abi}" ${USE_PYTHON}
- local has_abi=${?}
- use "python_targets_${impl}"
- local has_impl=${?}
-
- # 0 = has, 1 = does not have
- if [[ ${has_abi} == 0 && ${has_impl} == 1 ]]; then
- debug-print "${FUNCNAME}: ---> remove ${abi}"
- # remove from USE_PYTHON
- old=${old/${abi}/}
- removed+=( ${abi} )
- elif [[ ${has_abi} == 1 && ${has_impl} == 0 ]]; then
- debug-print "${FUNCNAME}: ---> add ${abi}"
- # add to USE_PYTHON
- new+=( ${abi} )
- fi
- done
-
- if [[ ${removed[@]} || ${new[@]} ]]; then
- old=( ${old} )
-
- debug-print "${FUNCNAME}: -> old: ${old[@]}"
- debug-print "${FUNCNAME}: -> new: ${new[@]}"
- debug-print "${FUNCNAME}: -> removed: ${removed[@]}"
-
- if [[ ${USE_PYTHON} ]]; then
- ewarn "It seems that your USE_PYTHON setting lists different Python"
- ewarn "implementations than your PYTHON_TARGETS variable. Please consider"
- ewarn "using the following value instead:"
- ewarn
- ewarn " USE_PYTHON='\033[35m${old[@]}${new[@]+ \033[1m${new[@]}}\033[0m'"
-
- if [[ ${removed[@]} ]]; then
- ewarn
- ewarn "(removed \033[31m${removed[@]}\033[0m)"
- fi
- else
- ewarn "It seems that you need to set USE_PYTHON to make sure that legacy"
- ewarn "packages will be built with respect to PYTHON_TARGETS correctly:"
- ewarn
- ewarn " USE_PYTHON='\033[35;1m${new[@]}\033[0m'"
- fi
-
- ewarn
- ewarn "Please note that after changing the USE_PYTHON variable, you may need"
- ewarn "to run 'python-updater' to rebuild affected packages."
- ewarn
- ewarn "For more information on PYTHON_TARGETS and python.eclass"
- ewarn "compatibility, please see the relevant Wiki article [1]."
- ewarn
- ewarn "[1] https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS"
- fi
- fi
-}
-
# @FUNCTION: _python_obtain_impls
# @INTERNAL
# @DESCRIPTION:
@@ -665,7 +451,6 @@ _python_obtain_impls() {
fi
_python_validate_useflags
- _python_check_USE_PYTHON
MULTIBUILD_VARIANTS=()