Avoid including python.eclass more than once.
authorMike Gilbert <floppym@gentoo.org>
Sun, 1 Jan 2012 05:02:27 +0000 (05:02 +0000)
committerMike Gilbert <floppym@gentoo.org>
Sun, 1 Jan 2012 05:02:27 +0000 (05:02 +0000)
eclass/ChangeLog
eclass/distutils.eclass
eclass/python.eclass

index b170df5b9383637f08b459e640aa9ba7505e5980..566dd1df23f0a931f2d2f3f598c2afb91caa87ab 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.65 2011/12/31 00:46:04 pesa Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.66 2012/01/01 05:02:27 floppym Exp $
+
+  01 Jan 2012; Mike Gilbert <floppym@gentoo.org> distutils.eclass,
+  python.eclass:
+  Avoid including python.eclass more than once.
 
   31 Dec 2011; Davide Pesavento <pesa@gentoo.org> qt4-build.eclass:
   Respect {C,CXX,LD}FLAGS during config.tests (bug #336618).
index cc6130aa901d3991f448de190a1f562493245fe4..2b4e1c21ff626a033ef5093a4e19790c6540ed8c 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.80 2011/04/12 18:49:03 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.81 2012/01/01 05:02:27 floppym Exp $
 
 # @ECLASS: distutils.eclass
 # @MAINTAINER:
@@ -9,7 +9,11 @@
 # @DESCRIPTION:
 # The distutils eclass defines phase functions for packages with build systems using Distutils.
 
-inherit multilib python
+if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then
+       inherit python
+fi
+
+inherit multilib
 
 case "${EAPI:-0}" in
        0|1)
index 7cd241f099643b09bef3ef650122373e40ec2334..a0a562f04a6a80e769b60cf989516a1f0463b330 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# 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.143 2011/12/19 01:29:57 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.144 2012/01/01 05:02:27 floppym Exp $
 
 # @ECLASS: python.eclass
 # @MAINTAINER:
@@ -9,7 +9,19 @@
 # @DESCRIPTION:
 # The python eclass contains miscellaneous, useful functions for Python packages.
 
-inherit multilib
+# Must call inherit before EXPORT_FUNCTIONS to avoid QA warning.
+if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then
+       inherit multilib
+fi
+
+# Export pkg_setup every time to avoid issues with eclass inheritance order.
+if ! has "${EAPI:-0}" 0 1 2 3 || { has "${EAPI:-0}" 2 3 && [[ -n "${PYTHON_USE_WITH}" || -n "${PYTHON_USE_WITH_OR}" ]]; }; then
+       EXPORT_FUNCTIONS pkg_setup
+fi
+
+# Avoid processing this eclass more than once.
+if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then
+_PYTHON_ECLASS_INHERITED="1"
 
 if ! has "${EAPI:-0}" 0 1 2 3 4; then
        die "API of python.eclass in EAPI=\"${EAPI}\" not established"
@@ -463,10 +475,6 @@ python_pkg_setup() {
        PYTHON_PKG_SETUP_EXECUTED="1"
 }
 
-if ! has "${EAPI:-0}" 0 1 2 3 || { has "${EAPI:-0}" 2 3 && [[ -n "${PYTHON_USE_WITH}" || -n "${PYTHON_USE_WITH_OR}" ]]; }; then
-       EXPORT_FUNCTIONS pkg_setup
-fi
-
 _PYTHON_SHEBANG_BASE_PART_REGEX='^#![[:space:]]*([^[:space:]]*/usr/bin/env[[:space:]]+)?([^[:space:]]*/)?(jython|pypy-c|python)'
 
 # @FUNCTION: python_convert_shebangs
@@ -3114,3 +3122,5 @@ python_mod_cleanup() {
 # ================================================================================================
 # ===================================== DEPRECATED FUNCTIONS =====================================
 # ================================================================================================
+
+fi # _PYTHON_ECLASS_INHERITED