From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RgNMb-0004Wp-0X for garchives@archives.gentoo.org; Thu, 29 Dec 2011 21:18:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6509921C026; Thu, 29 Dec 2011 21:18:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2169B21C026 for ; Thu, 29 Dec 2011 21:18:10 +0000 (UTC) Received: from [192.168.0.4] (d14-69-47-19.try.wideopenwest.com [69.14.19.47]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 449961B4061 for ; Thu, 29 Dec 2011 21:18:09 +0000 (UTC) Message-ID: <4EFCD90C.3010309@gentoo.org> Date: Thu, 29 Dec 2011 16:18:04 -0500 From: Mike Gilbert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111116 Thunderbird/8.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org MIME-Version: 1.0 To: gentoo-python@lists.gentoo.org Subject: [gentoo-python] [PATCH] python.eclass: Avoid multiple inclusion X-Enigmail-Version: 1.3.3 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigDF3CF2575F78DAD4FEBC3A72" X-Archives-Salt: e341ef66-dad2-499d-8e2a-974ff7e1b3dc X-Archives-Hash: e14cb474440a7e4f43cf364af6e2c839 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDF3CF2575F78DAD4FEBC3A72 Content-Type: multipart/mixed; boundary="------------010807040404020300020508" This is a multi-part message in MIME format. --------------010807040404020300020508 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mike's doing it in autotools.eclass, so let's do it too. This will aid in debugging code in global scope and prevent duplicate dependency atoms from being generated. Also, per vapier[1], it could have some performance enhancing qualities. The distutils part avoids sourcing python.eclass if distutils is inherited after python. We can add similar blocks to other eclass consumers of python.eclass. I think it's a good idea, and you should to. Please see attached patch. Please let me know you have some objection; otherwise I will commit on Sunday, Jan 1. [1] http://archives.gentoo.org/gentoo-dev/msg_18dab542c1c59873f8cb68c96cdf661= 9.xml --------------010807040404020300020508 Content-Type: text/x-patch; name="python-eclass-multiple-inclusion.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="python-eclass-multiple-inclusion.patch" Index: distutils.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v retrieving revision 1.80 diff -u -B -r1.80 distutils.eclass --- distutils.eclass 12 Apr 2011 18:49:03 -0000 1.80 +++ distutils.eclass 29 Dec 2011 21:12:19 -0000 @@ -9,7 +9,11 @@ # @DESCRIPTION: # The distutils eclass defines phase functions for packages with build s= ystems using Distutils. =20 -inherit multilib python +if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then + inherit python +fi + +inherit multilib =20 case "${EAPI:-0}" in 0|1) Index: python.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v retrieving revision 1.143 diff -u -B -r1.143 python.eclass --- python.eclass 19 Dec 2011 01:29:57 -0000 1.143 +++ python.eclass 29 Dec 2011 21:12:21 -0000 @@ -9,6 +9,9 @@ # @DESCRIPTION: # The python eclass contains miscellaneous, useful functions for Python = packages. =20 +if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then +_PYTHON_ECLASS_INHERITED=3D"1" + inherit multilib =20 if ! has "${EAPI:-0}" 0 1 2 3 4; then @@ -3114,3 +3117,5 @@ # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DEPRECATED FUNCTIONS =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +fi --------------010807040404020300020508-- --------------enigDF3CF2575F78DAD4FEBC3A72 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iF4EAREIAAYFAk782Q0ACgkQC77qH+pIQ6QiGgD6AuikPjqOScIJKhEagm7BB78v UK5BsjWBGxha+taHWGcBAKdnT6QCyLzDHmE6P1m/FF8vJudEIovqQ6GcyX4o0Omq =9079 -----END PGP SIGNATURE----- --------------enigDF3CF2575F78DAD4FEBC3A72--