diff options
author | Mike Gilbert <floppym@gentoo.org> | 2012-01-30 20:18:38 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2012-01-30 20:18:38 +0000 |
commit | f0c076e7e795af7f5e5cfe93da51773b18acf4dd (patch) | |
tree | d28a8f3e62e29b57020e0db495435001d6c37103 /eclass/python.eclass | |
parent | Fix SRC_URI, add blocker for dev-python/pisa. (diff) | |
download | historical-f0c076e7e795af7f5e5cfe93da51773b18acf4dd.tar.gz historical-f0c076e7e795af7f5e5cfe93da51773b18acf4dd.tar.bz2 historical-f0c076e7e795af7f5e5cfe93da51773b18acf4dd.zip |
Detect needless usage of python_convert_shebangs(). Patch by Arfrever.
Diffstat (limited to 'eclass/python.eclass')
-rw-r--r-- | eclass/python.eclass | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/eclass/python.eclass b/eclass/python.eclass index 2e7ae8459968..66a316b95344 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.145 2012/01/21 19:48:20 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.146 2012/01/30 20:18:38 floppym Exp $ # @ECLASS: python.eclass # @MAINTAINER: @@ -11,7 +11,7 @@ # Must call inherit before EXPORT_FUNCTIONS to avoid QA warning. if [[ -z "${_PYTHON_ECLASS_INHERITED}" ]]; then - inherit multilib + inherit eutils multilib fi # Export pkg_setup every time to avoid issues with eclass inheritance order. @@ -484,7 +484,7 @@ _PYTHON_SHEBANG_BASE_PART_REGEX='^#![[:space:]]*([^[:space:]]*/usr/bin/env[[:spa python_convert_shebangs() { _python_check_python_pkg_setup_execution - local argument file files=() only_executables="0" python_interpreter quiet="0" recursive="0" + local argument file files=() only_executables="0" python_interpreter quiet="0" recursive="0" shebangs_converted="0" while (($#)); do case "$1" in @@ -549,6 +549,8 @@ python_convert_shebangs() { if [[ "$(head -n1 "${file}")" =~ ${_PYTHON_SHEBANG_BASE_PART_REGEX} ]]; then [[ "$(sed -ne "2p" "${file}")" =~ ^"# Gentoo '".*"' wrapper script generated by python_generate_wrapper_scripts()"$ ]] && continue + shebangs_converted="1" + if [[ "${quiet}" == "0" ]]; then einfo "Converting shebang in '${file}'" fi @@ -556,6 +558,10 @@ python_convert_shebangs() { sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?\(jython\|pypy-c\|python\)\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${python_interpreter}\6:" -i "${file}" || die "Conversion of shebang in '${file}' failed" fi done + + if [[ "${shebangs_converted}" == "0" ]]; then + eqawarn "${FUNCNAME}(): Python scripts not found" + fi } # @FUNCTION: python_clean_py-compile_files |