summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-11-24 21:07:14 +0000
committerMichał Górny <mgorny@gentoo.org>2012-11-24 21:07:14 +0000
commite11f2e880170ec409ca43860139b31979e6392ff (patch)
tree6723137aa450f44a150ca563abe18fd9ce1b9a24 /eclass
parentold (diff)
downloadgentoo-2-e11f2e880170ec409ca43860139b31979e6392ff.tar.gz
gentoo-2-e11f2e880170ec409ca43860139b31979e6392ff.tar.bz2
gentoo-2-e11f2e880170ec409ca43860139b31979e6392ff.zip
Fix EAPI checks, add double- and colliding include guards.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog15
-rw-r--r--eclass/distutils-r1.eclass14
-rw-r--r--eclass/python-r1.eclass27
-rw-r--r--eclass/python-single-r1.eclass12
-rw-r--r--eclass/python-utils-r1.eclass15
-rw-r--r--eclass/python.eclass6
6 files changed, 75 insertions, 14 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 5c304a1aebee..aeea99a23a13 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.517 2012/11/24 19:00:49 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.518 2012/11/24 21:07:14 mgorny Exp $
+
+ 24 Nov 2012; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass,
+ python.eclass, python-r1.eclass, python-single-r1.eclass,
+ python-utils-r1.eclass:
+ Fix EAPI checks, add double- and colliding include guards.
+
+ 24 Nov 2012; Michał Górny <mgorny@gentoo.org> +python-single-r1.eclass:
+ Introduce python-single-r1 to handle Python packages not supporting multiple
+ implementations.
+
+ 24 Nov 2012; Michał Górny <mgorny@gentoo.org> python-r1.eclass,
+ +python-utils-r1.eclass:
+ Move common Python functions to python-utils-r1.
24 Nov 2012; Pacho Ramos <pacho@gentoo.org> gnome2.eclass:
Handle documentation as 'default' for eapi5 and newer (as discussed via
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index bafa6239ff7f..129cd49c9312 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.18 2012/11/05 15:15:32 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.19 2012/11/24 21:07:14 mgorny Exp $
# @ECLASS: distutils-r1
# @MAINTAINER:
@@ -40,10 +40,13 @@
# Also, please note that distutils-r1 will always inherit python-r1
# as well. Thus, all the variables defined and documented there are
# relevant to the packages using distutils-r1.
+#
+# For more information, please see the python-r1 Developer's Guide:
+# http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml
-case "${EAPI}" in
+case "${EAPI:-0}" in
0|1|2|3)
- die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5)
;;
@@ -52,6 +55,8 @@ case "${EAPI}" in
;;
esac
+if [[ ! ${_DISTUTILS_R1} ]]; then
+
inherit eutils python-r1
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
@@ -430,3 +435,6 @@ distutils-r1_src_install() {
distutils-r1_python_install_all
fi
}
+
+_DISTUTILS_R1=1
+fi
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 1f04728cd8aa..fed023960277 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.21 2012/11/24 20:51:14 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.22 2012/11/24 21:07:14 mgorny Exp $
# @ECLASS: python-r1
# @MAINTAINER:
@@ -28,9 +28,9 @@
# For more information, please see the python-r1 Developer's Guide:
# http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml
-case "${EAPI}" in
+case "${EAPI:-0}" in
0|1|2|3)
- die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5)
# EAPI=4 needed for REQUIRED_USE
@@ -40,6 +40,8 @@ case "${EAPI}" in
;;
esac
+if [[ ! ${_PYTHON_R1} ]]; then
+
inherit python-utils-r1
# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
@@ -195,6 +197,10 @@ _python_set_globals
python_copy_sources() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${_PYTHON_SINGLE_R1} ]]; then
+ die "${FUNCNAME} must not be used with python-single-r1 eclass."
+ fi
+
local impl
local bdir=${BUILD_DIR:-${S}}
@@ -422,6 +428,10 @@ _python_check_USE_PYTHON() {
python_foreach_impl() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${_PYTHON_SINGLE_R1} ]]; then
+ die "${FUNCNAME} must not be used with python-single-r1 eclass."
+ fi
+
_python_check_USE_PYTHON
local impl
@@ -451,6 +461,10 @@ python_foreach_impl() {
python_export_best() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${_PYTHON_SINGLE_R1} ]]; then
+ die "${FUNCNAME} must not be used with python-single-r1 eclass."
+ fi
+
[[ ${#} -gt 0 ]] || set -- EPYTHON PYTHON
local impl best
@@ -478,6 +492,10 @@ python_export_best() {
python_replicate_script() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${_PYTHON_SINGLE_R1} ]]; then
+ die "${FUNCNAME} must not be used with python-single-r1 eclass."
+ fi
+
local suffixes=()
_add_suffix() {
@@ -502,3 +520,6 @@ python_replicate_script() {
_python_ln_rel "${ED}"/usr/bin/python-exec "${f}" || die
done
}
+
+_PYTHON_R1=1
+fi
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 263849b88cd8..d0f6df3c14d6 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 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.1 2012/11/24 20:53:53 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v 1.2 2012/11/24 21:07:14 mgorny Exp $
# @ECLASS: python-single-r1
# @MAINTAINER:
@@ -30,9 +30,9 @@
# For more information, please see the python-r1 Developer's Guide:
# http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml
-case "${EAPI}" in
+case "${EAPI:-0}" in
0|1|2|3)
- die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5)
# EAPI=4 needed by python-r1
@@ -42,6 +42,8 @@ case "${EAPI}" in
;;
esac
+if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
+
inherit python-r1
EXPORT_FUNCTIONS pkg_setup
@@ -85,6 +87,7 @@ _python_single_set_globals
python-single-r1_pkg_setup() {
debug-print-function ${FUNCNAME} "${@}"
+ local impl
for impl in "${_PYTHON_ALL_IMPLS[@]}"; do
if has "${impl}" "${PYTHON_COMPAT[@]}" \
&& use "python_single_target_${impl}"
@@ -94,3 +97,6 @@ python-single-r1_pkg_setup() {
fi
done
}
+
+_PYTHON_SINGLE_R1=1
+fi
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index afe90b34ba9e..ad569198ec15 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 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.1 2012/11/24 20:51:14 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.2 2012/11/24 21:07:14 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -20,9 +20,9 @@
# For more information, please see the python-r1 Developer's Guide:
# http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml
-case "${EAPI}" in
+case "${EAPI:-0}" in
0|1|2|3)
- die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5)
# EAPI=4 makes die behavior clear
@@ -32,6 +32,12 @@ case "${EAPI}" in
;;
esac
+if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then
+ die 'python-r1 suite eclasses can not be used with python.eclass.'
+fi
+
+if [[ ! ${_PYTHON_UTILS_R1} ]]; then
+
inherit multilib
# @ECLASS-VARIABLE: PYTHON
@@ -438,3 +444,6 @@ python_domodule() {
;;
esac
}
+
+_PYTHON_UTILS_R1=1
+fi
diff --git a/eclass/python.eclass b/eclass/python.eclass
index d98e36be5df1..2d551a85a0ba 100644
--- a/eclass/python.eclass
+++ b/eclass/python.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.160 2012/10/02 01:22:57 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.161 2012/11/24 21:07:14 mgorny Exp $
# @ECLASS: python.eclass
# @MAINTAINER:
@@ -9,6 +9,10 @@
# @DESCRIPTION:
# The python eclass contains miscellaneous, useful functions for Python packages.
+if [[ ${_PYTHON_UTILS_R1} ]]; then
+ die 'python.eclass can not be used with python-r1 suite eclasses.'
+fi
+
# Must call inherit before EXPORT_FUNCTIONS to avoid QA warning.
if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then
inherit multilib