diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-07-11 07:20:13 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-07-11 07:20:13 +0000 |
commit | 72e131e9a7463c29e02fbc70cb67d83b401518e8 (patch) | |
tree | ce44505a88235906030e4c350a9adcc1755bb893 /eclass | |
parent | Fix typo in compileall call. (diff) | |
download | historical-72e131e9a7463c29e02fbc70cb67d83b401518e8.tar.gz historical-72e131e9a7463c29e02fbc70cb67d83b401518e8.tar.bz2 historical-72e131e9a7463c29e02fbc70cb67d83b401518e8.zip |
Add a safety check for using python_optimize() in pkg_*.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/python-utils-r1.eclass | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index bed74d9b33c1..e7541b8a21b4 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.876 2013/07/11 06:57:37 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.877 2013/07/11 07:20:13 mgorny Exp $ + + 11 Jul 2013; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass: + Add a safety check for using python_optimize() in pkg_*. 11 Jul 2013; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass: Fix typo in compileall call. diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 918bf0024f50..3565879dca0f 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 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.28 2013/07/11 06:57:37 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.29 2013/07/11 07:20:13 mgorny Exp $ # @ECLASS: python-utils-r1 # @MAINTAINER: @@ -594,6 +594,15 @@ _python_ln_rel() { python_optimize() { debug-print-function ${FUNCNAME} "${@}" + if [[ ${EBUILD_PHASE} == pre* || ${EBUILD_PHASE} == post* ]]; then + eerror "The new Python eclasses expect the compiled Python files to" + eerror "be controlled by the Package Manager. For this reason," + eerror "the python_optimize function can be used only during src_* phases" + eerror "(src_install most commonly) and not during pkg_* phases." + echo + die "python_optimize is not to be used in pre/post* phases" + fi + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' local PYTHON=${PYTHON} |