summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2015-02-20 08:18:05 +0000
committerPatrick Lauer <patrick@gentoo.org>2015-02-20 08:18:05 +0000
commit2d2ac21413e6ec5f5ad2d5c444eca55624e871d9 (patch)
tree22ba6adef9b349fb390c38f803925bcb34176949 /eclass
parentInclude all deps (bug #540634) (diff)
downloadhistorical-2d2ac21413e6ec5f5ad2d5c444eca55624e871d9.tar.gz
historical-2d2ac21413e6ec5f5ad2d5c444eca55624e871d9.tar.bz2
historical-2d2ac21413e6ec5f5ad2d5c444eca55624e871d9.zip
Revert random mgorny madness
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/distutils-r1.eclass29
-rw-r--r--eclass/python-r1.eclass3
-rw-r--r--eclass/python-single-r1.eclass4
-rw-r--r--eclass/python-utils-r1.eclass73
5 files changed, 78 insertions, 37 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index d204e233951d..7c6dad3254bc 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1541 2015/02/19 18:52:06 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1542 2015/02/20 08:14:22 patrick Exp $
+
+ 20 Feb 2015; Patrick Lauer <patrick@gentoo.org> python-r1.eclass,
+ python-single-r1.eclass:
+ Revert random mgorny madness
19 Feb 2015; Michał Górny <mgorny@gentoo.org> python-r1.eclass,
python-single-r1.eclass, python-utils-r1.eclass:
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 18ed4b99d31f..373add33fa27 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-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/distutils-r1.eclass,v 1.111 2015/02/19 17:22:25 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.112 2015/02/20 08:18:05 patrick Exp $
# @ECLASS: distutils-r1
# @MAINTAINER:
@@ -393,7 +393,7 @@ _distutils-r1_create_setup_cfg() {
root = ${D}
_EOF_
- if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
+ if [[ ! ${DISTUTILS_SINGLE_IMPL} ]] && _python_want_python_exec2; then
cat >> "${HOME}"/.pydistutils.cfg <<-_EOF_ || die
install-scripts = $(python_get_scriptdir)
_EOF_
@@ -444,7 +444,11 @@ _distutils-r1_wrap_scripts() {
local bindir=${2}
local PYTHON_SCRIPTDIR
- python_export PYTHON_SCRIPTDIR
+ if _python_want_python_exec2; then
+ python_export PYTHON_SCRIPTDIR
+ else
+ PYTHON_SCRIPTDIR=${bindir}
+ fi
local f python_files=() non_python_files=()
@@ -458,7 +462,7 @@ _distutils-r1_wrap_scripts() {
if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then
debug-print "${FUNCNAME}: matching shebang: ${shebang}"
python_files+=( "${f}" )
- else
+ elif _python_want_python_exec2; then
debug-print "${FUNCNAME}: non-matching shebang: ${shebang}"
non_python_files+=( "${f}" )
fi
@@ -469,11 +473,18 @@ _distutils-r1_wrap_scripts() {
for f in "${python_files[@]}"; do
local basename=${f##*/}
+ if ! _python_want_python_exec2; then
+ local newf=${f%/*}/${basename}-${EPYTHON}
+ debug-print "${FUNCNAME}: renaming ${f#${path}/} to ${newf#${path}/}"
+ mv "${f}" "${newf}" || die
+ fi
+
debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}"
- _python_ln_rel "${path}${EPREFIX}"/usr/lib/python-exec/python-exec2 \
+ _python_ln_rel "${path}${EPREFIX}"$(_python_get_wrapper_path) \
"${path}${bindir}/${basename}" || die
done
+ # (non-empty only with python-exec:2)
for f in "${non_python_files[@]}"; do
local basename=${f##*/}
@@ -533,11 +544,15 @@ distutils-r1_python_install() {
case "${a}" in
--install-scripts=*)
scriptdir=${a#--install-scripts=}
- unset "${arg_var}"
+ if _python_want_python_exec2; then
+ unset "${arg_var}"
+ fi
;;
--install-scripts)
scriptdir=${!1}
- unset "${arg_var}" "${1}"
+ if _python_want_python_exec2; then
+ unset "${arg_var}" "${1}"
+ fi
shift
;;
esac
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 2ce3aa011058..ec8c1db75f2d 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.86 2015/02/19 18:52:06 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.87 2015/02/20 08:14:22 patrick Exp $
# @ECLASS: python-r1
# @MAINTAINER:
@@ -652,7 +652,6 @@ _python_obtain_impls() {
_python_validate_useflags
_python_check_USE_PYTHON
- _python_check_EAPI
MULTIBUILD_VARIANTS=()
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index d88fecc8849e..8b994f8cf698 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-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-single-r1.eclass,v 1.33 2015/02/19 18:52:06 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v 1.34 2015/02/20 08:14:22 patrick Exp $
# @ECLASS: python-single-r1
# @MAINTAINER:
@@ -379,8 +379,6 @@ python_gen_cond_dep() {
python_setup() {
debug-print-function ${FUNCNAME} "${@}"
- _python_check_EAPI
-
unset EPYTHON
local impl impls=()
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 1dd367a04588..b36d81822997 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-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-utils-r1.eclass,v 1.77 2015/02/19 18:52:06 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.78 2015/02/20 08:18:05 patrick Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -635,14 +635,21 @@ python_newexe() {
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
[[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>"
- local wrapd=${python_scriptroot:-${DESTTREE}/bin}
+ local d=${python_scriptroot:-${DESTTREE}/bin}
+ local wrapd=${d}
local f=${1}
- local newfn=${2}
-
- local PYTHON_SCRIPTDIR d
- python_export PYTHON_SCRIPTDIR
- d=${PYTHON_SCRIPTDIR#${EPREFIX}}
+ local barefn=${2}
+ local newfn
+
+ if _python_want_python_exec2; then
+ local PYTHON_SCRIPTDIR
+ python_export PYTHON_SCRIPTDIR
+ d=${PYTHON_SCRIPTDIR#${EPREFIX}}
+ newfn=${barefn}
+ else
+ newfn=${barefn}-${EPYTHON}
+ fi
(
dodir "${wrapd}"
@@ -651,7 +658,7 @@ python_newexe() {
)
# install the wrapper
- _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \
+ _python_ln_rel "${ED%/}"$(_python_get_wrapper_path) \
"${ED%/}/${wrapd}/${barefn}" || die
# don't use this at home, just call python_doscript() instead
@@ -1092,6 +1099,40 @@ python_fix_shebang() {
done
}
+# @FUNCTION: _python_want_python_exec2
+# @INTERNAL
+# @DESCRIPTION:
+# Check whether we should be using python-exec:2.
+_python_want_python_exec2() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ # EAPI 4 lacks slot operators, so just fix it on python-exec:2.
+ [[ ${EAPI} == 4 ]] && return 0
+
+ # Check if we cached the result, or someone put an override.
+ if [[ ! ${_PYTHON_WANT_PYTHON_EXEC2+1} ]]; then
+ has_version 'dev-lang/python-exec:2'
+ _PYTHON_WANT_PYTHON_EXEC2=$(( ! ${?} ))
+ fi
+
+ # Non-zero means 'yes', zero means 'no'.
+ [[ ${_PYTHON_WANT_PYTHON_EXEC2} != 0 ]]
+}
+
+# @FUNCTION: _python_get_wrapper_path
+# @INTERNAL
+# @DESCRIPTION:
+# Output path to proper python-exec slot.
+_python_get_wrapper_path() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ if _python_want_python_exec2; then
+ echo /usr/lib/python-exec/python-exec2
+ else
+ echo /usr/bin/python-exec
+ fi
+}
+
# @FUNCTION: python_export_utf8_locale
# @RETURN: 0 on success, 1 on failure.
# @DESCRIPTION:
@@ -1127,22 +1168,6 @@ python_export_utf8_locale() {
return 0
}
-# @FUNCTION: _python_check_EAPI
-# @INTERNAL
-# @DESCRIPTION:
-# Check whether the ebuild is not using deprecated EAPI 4. Output
-# a QA warning if it does.
-_python_check_EAPI() {
- if [[ ${EAPI} == 4 && ! ${_PYTHON_WARNED_EAPI} ]]; then
- eqawarn "This package is using still using EAPI=4. This results in package"
- eqawarn "dependencies violating PMS and causing issues for package managers."
- eqawarn "For this reason, using EAPI=4 in new Python packages will be banned"
- eqawarn "on 2015-03-20 (2 years and 6 months after approving EAPI 5)."
-
- _PYTHON_WARNED_EAPI=1
- fi
-}
-
# -- python.eclass functions --
_python_check_dead_variables() {