/[gentoo-x86]/eclass/python.eclass
Gentoo

Diff of /eclass/python.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.93 Revision 1.94
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.93 2010/03/12 18:27:01 betelgeuse Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.94 2010/03/13 13:46:20 arfrever Exp $
4 4
5# @ECLASS: python.eclass 5# @ECLASS: python.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Python Project <python@gentoo.org> 7# Gentoo Python Project <python@gentoo.org>
8# @BLURB: Eclass for Python packages 8# @BLURB: Eclass for Python packages
271 271
272# @ECLASS-VARIABLE: PYTHON_EXPORT_PHASE_FUNCTIONS 272# @ECLASS-VARIABLE: PYTHON_EXPORT_PHASE_FUNCTIONS
273# @DESCRIPTION: 273# @DESCRIPTION:
274# Set this to export phase functions for the following ebuild phases: 274# Set this to export phase functions for the following ebuild phases:
275# src_prepare, src_configure, src_compile, src_test, src_install. 275# src_prepare, src_configure, src_compile, src_test, src_install.
276if ! has "${EAPI:-0}" 0 1 && [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 276if ! has "${EAPI:-0}" 0 1; then
277 python_src_prepare() { 277 python_src_prepare() {
278 python_copy_sources 278 python_copy_sources
279 } 279 }
280 280
281 for python_default_function in src_configure src_compile src_test src_install; do 281 for python_default_function in src_configure src_compile src_test src_install; do
282 eval "python_${python_default_function}() { python_execute_function -d -s; }" 282 eval "python_${python_default_function}() {
283 python_execute_function -d -s \"\$@\"
284 }"
283 done 285 done
284 unset python_default_function 286 unset python_default_function
285 287
286 if [[ -n "${PYTHON_EXPORT_PHASE_FUNCTIONS}" ]]; then 288 if [[ -n "${PYTHON_EXPORT_PHASE_FUNCTIONS}" ]]; then
287 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install 289 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
306 if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3 4; then 308 if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3 4; then
307 local PYTHON_ABI restricted_ABI support_ABI supported_PYTHON_ABIS= 309 local PYTHON_ABI restricted_ABI support_ABI supported_PYTHON_ABIS=
308 PYTHON_ABI_SUPPORTED_VALUES="${_CPYTHON2_SUPPORTED_ABIS[@]} ${_CPYTHON3_SUPPORTED_ABIS[@]} ${_JYTHON_SUPPORTED_ABIS[@]}" 310 PYTHON_ABI_SUPPORTED_VALUES="${_CPYTHON2_SUPPORTED_ABIS[@]} ${_CPYTHON3_SUPPORTED_ABIS[@]} ${_JYTHON_SUPPORTED_ABIS[@]}"
309 311
310 if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then 312 if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then
311 local python2_enabled="0" python3_enabled="0" 313 local cpython_enabled="0"
312 314
313 if [[ -z "${USE_PYTHON}" ]]; then 315 if [[ -z "${USE_PYTHON}" ]]; then
314 die "USE_PYTHON variable is empty" 316 die "USE_PYTHON variable is empty"
315 fi 317 fi
316 318
317 for PYTHON_ABI in ${USE_PYTHON}; do 319 for PYTHON_ABI in ${USE_PYTHON}; do
318 if ! has "${PYTHON_ABI}" ${PYTHON_ABI_SUPPORTED_VALUES}; then 320 if ! has "${PYTHON_ABI}" ${PYTHON_ABI_SUPPORTED_VALUES}; then
319 die "USE_PYTHON variable contains invalid value '${PYTHON_ABI}'" 321 die "USE_PYTHON variable contains invalid value '${PYTHON_ABI}'"
320 fi 322 fi
321 323
322 if has "${PYTHON_ABI}" "${_CPYTHON2_SUPPORTED_ABIS[@]}"; then 324 if has "${PYTHON_ABI}" "${_CPYTHON2_SUPPORTED_ABIS[@]}" "${_CPYTHON3_SUPPORTED_ABIS[@]}"; then
323 python2_enabled="1" 325 cpython_enabled="1"
324 fi
325 if has "${PYTHON_ABI}" "${_CPYTHON3_SUPPORTED_ABIS[@]}"; then
326 python3_enabled="1"
327 fi 326 fi
328 327
329 support_ABI="1" 328 support_ABI="1"
330 for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do 329 for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do
331 if [[ "${PYTHON_ABI}" == ${restricted_ABI} ]]; then 330 if [[ "${PYTHON_ABI}" == ${restricted_ABI} ]]; then
338 337
339 if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then 338 if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then
340 die "USE_PYTHON variable does not enable any version of Python supported by ${CATEGORY}/${PF}" 339 die "USE_PYTHON variable does not enable any version of Python supported by ${CATEGORY}/${PF}"
341 fi 340 fi
342 341
343 if [[ "${python2_enabled}" == "0" ]]; then 342 if [[ "${cpython_enabled}" == "0" ]]; then
344 ewarn "USE_PYTHON variable does not enable any version of Python 2. This configuration is unsupported."
345 fi
346 if [[ "${python3_enabled}" == "0" ]]; then
347 ewarn "USE_PYTHON variable does not enable any version of Python 3. This configuration is unsupported."
348 fi
349 if [[ "${python2_enabled}" == "0" && "${python3_enabled}" == "0" ]]; then
350 die "USE_PYTHON variable does not enable any version of CPython" 343 die "USE_PYTHON variable does not enable any version of CPython"
351 fi 344 fi
352 else 345 else
353 local python_version python2_version= python3_version= support_python_major_version 346 local python_version python2_version= python3_version= support_python_major_version
354 347
494 487
495 if [[ -z "$(type -t "${function}")" ]]; then 488 if [[ -z "$(type -t "${function}")" ]]; then
496 die "${FUNCNAME}(): '${function}' function is not defined" 489 die "${FUNCNAME}(): '${function}' function is not defined"
497 fi 490 fi
498 else 491 else
499 if [[ "$#" -ne 0 ]]; then
500 die "${FUNCNAME}(): '--default-function' option and function name cannot be specified simultaneously"
501 fi
502 if has "${EAPI:-0}" 0 1; then 492 if has "${EAPI:-0}" 0 1; then
503 die "${FUNCNAME}(): '--default-function' option cannot be used in this EAPI" 493 die "${FUNCNAME}(): '--default-function' option cannot be used in this EAPI"
504 fi 494 fi
505 495
506 if [[ "${EBUILD_PHASE}" == "configure" ]]; then 496 if [[ "${EBUILD_PHASE}" == "configure" ]]; then
507 if has "${EAPI}" 2 3; then 497 if has "${EAPI}" 2 3; then
508 python_default_function() { 498 python_default_function() {
509 econf 499 econf "$@"
510 } 500 }
511 else 501 else
512 python_default_function() { 502 python_default_function() {
513 nonfatal econf 503 nonfatal econf "$@"
514 } 504 }
515 fi 505 fi
516 elif [[ "${EBUILD_PHASE}" == "compile" ]]; then 506 elif [[ "${EBUILD_PHASE}" == "compile" ]]; then
517 python_default_function() { 507 python_default_function() {
518 emake 508 emake "$@"
519 } 509 }
520 elif [[ "${EBUILD_PHASE}" == "test" ]]; then 510 elif [[ "${EBUILD_PHASE}" == "test" ]]; then
521 python_default_function() { 511 python_default_function() {
522 if emake -j1 -n check &> /dev/null; then 512 if emake -j1 -n check &> /dev/null; then
523 emake -j1 check 513 emake -j1 check "$@"
524 elif emake -j1 -n test &> /dev/null; then 514 elif emake -j1 -n test &> /dev/null; then
525 emake -j1 test 515 emake -j1 test "$@"
526 fi 516 fi
527 } 517 }
528 elif [[ "${EBUILD_PHASE}" == "install" ]]; then 518 elif [[ "${EBUILD_PHASE}" == "install" ]]; then
529 python_default_function() { 519 python_default_function() {
530 emake DESTDIR="${D}" install 520 emake DESTDIR="${D}" install "$@"
531 } 521 }
532 else 522 else
533 die "${FUNCNAME}(): '--default-function' option cannot be used in this ebuild phase" 523 die "${FUNCNAME}(): '--default-function' option cannot be used in this ebuild phase"
534 fi 524 fi
535 function="python_default_function" 525 function="python_default_function"
663 653
664 if [[ "$#" -eq 0 ]]; then 654 if [[ "$#" -eq 0 ]]; then
665 if [[ "${WORKDIR}" == "${S}" ]]; then 655 if [[ "${WORKDIR}" == "${S}" ]]; then
666 die "${FUNCNAME}() cannot be used" 656 die "${FUNCNAME}() cannot be used"
667 fi 657 fi
668 dirs=("${S}") 658 dirs=("${S%/}")
669 else 659 else
670 dirs=("$@") 660 dirs=("$@")
671 fi 661 fi
672 662
673 validate_PYTHON_ABIS 663 validate_PYTHON_ABIS
759 if [[ -f "${file}" && "${force}" == "0" ]]; then 749 if [[ -f "${file}" && "${force}" == "0" ]]; then
760 die "${FUNCNAME}(): '$1' already exists" 750 die "${FUNCNAME}(): '$1' already exists"
761 fi 751 fi
762 752
763 if [[ "${quiet}" == "0" ]]; then 753 if [[ "${quiet}" == "0" ]]; then
764 einfo "Generating '${file#${D%/}}' wrapper script" 754 einfo "Generating '${file#${ED%/}}' wrapper script"
765 fi 755 fi
766 756
767 cat << EOF > "${file}" 757 cat << EOF > "${file}"
768#!/usr/bin/env python 758#!/usr/bin/env python
769# Gentoo '${file##*/}' wrapper script 759# Gentoo '${file##*/}' wrapper script generated by python_generate_wrapper_scripts()
770 760
771import os 761import os
772import re 762import re
773import subprocess 763import subprocess
774import sys 764import sys
775 765
776EPYTHON_re = re.compile(r"^python(\d+\.\d+)$") 766EPYTHON_re = re.compile(r"^python(\d+\.\d+)$")
767python_shebang_re = re.compile(r"^#! *(${EPREFIX}/usr/bin/python|(${EPREFIX})?/usr/bin/env +(${EPREFIX}/usr/bin/)?python)")
768python_verification_output_re = re.compile("^GENTOO_PYTHON_TARGET_SCRIPT_PATH supported\n$")
777 769
778EOF 770EOF
779 if [[ "$?" != "0" ]]; then 771 if [[ "$?" != "0" ]]; then
780 die "${FUNCNAME}(): Generation of '$1' failed" 772 die "${FUNCNAME}(): Generation of '$1' failed"
781 fi 773 fi
796 raise ValueError 788 raise ValueError
797 except (OSError, ValueError): 789 except (OSError, ValueError):
798 sys.stderr.write("Execution of 'eselect python show${eselect_python_option:+ }${eselect_python_option}' failed\n") 790 sys.stderr.write("Execution of 'eselect python show${eselect_python_option:+ }${eselect_python_option}' failed\n")
799 sys.exit(1) 791 sys.exit(1)
800 792
801 eselect_output = eselect_process.stdout.read() 793 EPYTHON = eselect_process.stdout.read().rstrip("\n")
802 if not isinstance(eselect_output, str): 794 if not isinstance(EPYTHON, str):
803 # Python 3 795 # Python 3
804 eselect_output = eselect_output.decode() 796 EPYTHON = EPYTHON.decode()
805 797
806 EPYTHON_matched = EPYTHON_re.match(eselect_output) 798 EPYTHON_matched = EPYTHON_re.match(EPYTHON)
807 if EPYTHON_matched: 799 if EPYTHON_matched:
808 PYTHON_ABI = EPYTHON_matched.group(1) 800 PYTHON_ABI = EPYTHON_matched.group(1)
809 else: 801 else:
810 sys.stderr.write("'eselect python show${eselect_python_option:+ }${eselect_python_option}' printed unrecognized value '%s" % eselect_output) 802 sys.stderr.write("'eselect python show${eselect_python_option:+ }${eselect_python_option}' printed unrecognized value '%s" % EPYTHON)
811 sys.exit(1) 803 sys.exit(1)
812EOF 804EOF
813 if [[ "$?" != "0" ]]; then 805 if [[ "$?" != "0" ]]; then
814 die "${FUNCNAME}(): Generation of '$1' failed" 806 die "${FUNCNAME}(): Generation of '$1' failed"
815 fi 807 fi
821 raise ValueError 813 raise ValueError
822except (OSError, ValueError): 814except (OSError, ValueError):
823 sys.stderr.write("Execution of 'eselect python show${eselect_python_option:+ }${eselect_python_option}' failed\n") 815 sys.stderr.write("Execution of 'eselect python show${eselect_python_option:+ }${eselect_python_option}' failed\n")
824 sys.exit(1) 816 sys.exit(1)
825 817
826eselect_output = eselect_process.stdout.read() 818EPYTHON = eselect_process.stdout.read().rstrip("\n")
827if not isinstance(eselect_output, str): 819if not isinstance(EPYTHON, str):
828 # Python 3 820 # Python 3
829 eselect_output = eselect_output.decode() 821 EPYTHON = EPYTHON.decode()
830 822
831EPYTHON_matched = EPYTHON_re.match(eselect_output) 823EPYTHON_matched = EPYTHON_re.match(EPYTHON)
832if EPYTHON_matched: 824if EPYTHON_matched:
833 PYTHON_ABI = EPYTHON_matched.group(1) 825 PYTHON_ABI = EPYTHON_matched.group(1)
834else: 826else:
835 sys.stderr.write("'eselect python show${eselect_python_option:+ }${eselect_python_option}' printed unrecognized value '%s" % eselect_output) 827 sys.stderr.write("'eselect python show${eselect_python_option:+ }${eselect_python_option}' printed unrecognized value '%s" % EPYTHON)
836 sys.exit(1) 828 sys.exit(1)
837EOF 829EOF
838 if [[ "$?" != "0" ]]; then 830 if [[ "$?" != "0" ]]; then
839 die "${FUNCNAME}(): Generation of '$1' failed" 831 die "${FUNCNAME}(): Generation of '$1' failed"
840 fi 832 fi
841 fi 833 fi
842 cat << EOF >> "${file}" 834 cat << EOF >> "${file}"
843 835
836wrapper_script_path = os.path.realpath(sys.argv[0])
837target_executable_path = "%s-%s" % (wrapper_script_path, PYTHON_ABI)
844os.environ["PYTHON_SCRIPT_NAME"] = sys.argv[0] 838os.environ["GENTOO_PYTHON_WRAPPER_SCRIPT_PATH"] = sys.argv[0]
845target_executable = "%s-%s" % (os.path.realpath(sys.argv[0]), PYTHON_ABI) 839os.environ["GENTOO_PYTHON_TARGET_SCRIPT_PATH"] = target_executable_path
846if not os.path.exists(target_executable): 840if not os.path.exists(target_executable_path):
847 sys.stderr.write("'%s' does not exist\n" % target_executable) 841 sys.stderr.write("'%s' does not exist\n" % target_executable_path)
848 sys.exit(1) 842 sys.exit(1)
849 843
844target_executable = open(target_executable_path, "rb")
845target_executable_first_line = target_executable.readline()
846if not isinstance(target_executable_first_line, str):
847 # Python 3
848 target_executable_first_line = target_executable_first_line.decode("utf_8", "replace")
849
850python_shebang_matched = python_shebang_re.match(target_executable_first_line)
851target_executable.close()
852
853if python_shebang_matched:
854 try:
855 python_interpreter_path = "${EPREFIX}/usr/bin/%s" % EPYTHON
856 os.environ["GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION"] = "1"
857 python_verification_process = subprocess.Popen([python_interpreter_path, "-c", "pass"], stdout=subprocess.PIPE)
858 del os.environ["GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION"]
859 if python_verification_process.wait() != 0:
860 raise ValueError
861
862 python_verification_output = python_verification_process.stdout.read()
863 if not isinstance(python_verification_output, str):
864 # Python 3
865 python_verification_output = python_verification_output.decode()
866
867 if not python_verification_output_re.match(python_verification_output):
868 raise ValueError
869
870 os.execv(python_interpreter_path, [python_interpreter_path] + sys.argv)
871 except:
872 pass
873 if "GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION" in os.environ:
874 del os.environ["GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION"]
875
850os.execv(target_executable, sys.argv) 876os.execv(target_executable_path, sys.argv)
851EOF 877EOF
852 if [[ "$?" != "0" ]]; then 878 if [[ "$?" != "0" ]]; then
853 die "${FUNCNAME}(): Generation of '$1' failed" 879 die "${FUNCNAME}(): Generation of '$1' failed"
854 fi 880 fi
855 fperms +x "${file#${ED%/}}" || die "fperms '${file}' failed" 881 fperms +x "${file#${ED%/}}" || die "fperms '${file}' failed"
1017 die "${FUNCNAME}(): Internal error in \`eselect python show --python3\`" 1043 die "${FUNCNAME}(): Internal error in \`eselect python show --python3\`"
1018 fi 1044 fi
1019 elif [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then 1045 elif [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
1020 PYTHON_ABI="$("${EPREFIX}/usr/bin/python" -c "${_PYTHON_ABI_EXTRACTION_COMMAND}")" 1046 PYTHON_ABI="$("${EPREFIX}/usr/bin/python" -c "${_PYTHON_ABI_EXTRACTION_COMMAND}")"
1021 elif [[ -z "${PYTHON_ABI}" ]]; then 1047 elif [[ -z "${PYTHON_ABI}" ]]; then
1022 die "${FUNCNAME}(): Invalid usage: Python ABI not specified" 1048 die "${FUNCNAME}(): Invalid usage: ${FUNCNAME}() should be used in ABI-specific local scope"
1023 fi 1049 fi
1024 elif [[ "$#" -eq 1 ]]; then 1050 elif [[ "$#" -eq 1 ]]; then
1025 if [[ "${final_ABI}" == "1" ]]; then 1051 if [[ "${final_ABI}" == "1" ]]; then
1026 die "${FUNCNAME}(): '--final-ABI' option and Python ABI cannot be specified simultaneously" 1052 die "${FUNCNAME}(): '--final-ABI' option and Python ABI cannot be specified simultaneously"
1027 fi 1053 fi
1485 for file in "${files[@]}"; do 1511 for file in "${files[@]}"; do
1486 file="${file#./}" 1512 file="${file#./}"
1487 [[ "${only_executables}" == "1" && ! -x "${file}" ]] && continue 1513 [[ "${only_executables}" == "1" && ! -x "${file}" ]] && continue
1488 1514
1489 if [[ "$(head -n1 "${file}")" =~ ^'#!'.*python ]]; then 1515 if [[ "$(head -n1 "${file}")" =~ ^'#!'.*python ]]; then
1516 [[ "$(sed -ne "2p" "${file}")" =~ ^"# Gentoo '".*"' wrapper script generated by python_generate_wrapper_scripts()"$ ]] && continue
1517
1490 if [[ "${quiet}" == "0" ]]; then 1518 if [[ "${quiet}" == "0" ]]; then
1491 einfo "Converting shebang in '${file}'" 1519 einfo "Converting shebang in '${file}'"
1492 fi 1520 fi
1521
1493 sed -e "1s/python\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?/python${python_version}/" -i "${file}" || die "Conversion of shebang in '${file}' failed" 1522 sed -e "1s/python\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?/python${python_version}/" -i "${file}" || die "Conversion of shebang in '${file}' failed"
1494 1523
1495 # Delete potential whitespace after "#!". 1524 # Delete potential whitespace after "#!".
1496 sed -e '1s/\(^#!\)[[:space:]]*/\1/' -i "${file}" || die "sed '${file}' failed" 1525 sed -e '1s/\(^#!\)[[:space:]]*/\1/' -i "${file}" || die "sed '${file}' failed"
1497 fi 1526 fi
1498 done 1527 done
1528}
1529
1530# @FUNCTION: python_clean_sitedirs
1531# @DESCRIPTION:
1532# Delete needless files in site-packages directories in ${ED}.
1533python_clean_sitedirs() {
1534 _python_initialize_prefix_variables
1535
1536 find "${ED}"usr/$(get_libdir)/python*/site-packages "(" -name "*.c" -o -name "*.h" -o -name "*.la" ")" -type f -print0 | xargs -0 rm -f
1499} 1537}
1500 1538
1501# ================================================================================================ 1539# ================================================================================================
1502# ================================ FUNCTIONS FOR RUNNING OF TESTS ================================ 1540# ================================ FUNCTIONS FOR RUNNING OF TESTS ================================
1503# ================================================================================================ 1541# ================================================================================================
1982 if [[ -d "${path}" ]]; then 2020 if [[ -d "${path}" ]]; then
1983 find "${path}" "(" -name "*.py[co]" -o -name "*\$py.class" ")" -print0 | while read -rd ''; do 2021 find "${path}" "(" -name "*.py[co]" -o -name "*\$py.class" ")" -print0 | while read -rd ''; do
1984 if [[ "${REPLY}" == *[co] ]]; then 2022 if [[ "${REPLY}" == *[co] ]]; then
1985 py_file="${REPLY%[co]}" 2023 py_file="${REPLY%[co]}"
1986 [[ -f "${py_file}" || (! -f "${py_file}c" && ! -f "${py_file}o") ]] && continue 2024 [[ -f "${py_file}" || (! -f "${py_file}c" && ! -f "${py_file}o") ]] && continue
1987 einfo "${_BLUE}<<< ${py_file}[co]${_NORMAL}" 2025 echo "${_BLUE}<<< ${py_file}[co]${_NORMAL}"
1988 rm -f "${py_file}"[co] 2026 rm -f "${py_file}"[co]
1989 elif [[ "${REPLY}" == *\$py.class ]]; then 2027 elif [[ "${REPLY}" == *\$py.class ]]; then
1990 py_file="${REPLY%\$py.class}.py" 2028 py_file="${REPLY%\$py.class}.py"
1991 [[ -f "${py_file}" || ! -f "${py_file%.py}\$py.class" ]] && continue 2029 [[ -f "${py_file}" || ! -f "${py_file%.py}\$py.class" ]] && continue
1992 einfo "${_BLUE}<<< ${py_file%.py}\$py.class${_NORMAL}" 2030 echo "${_BLUE}<<< ${py_file%.py}\$py.class${_NORMAL}"
1993 rm -f "${py_file%.py}\$py.class" 2031 rm -f "${py_file%.py}\$py.class"
1994 fi 2032 fi
1995 done 2033 done
1996 2034
1997 # Attempt to delete directories, which may be empty. 2035 # Attempt to delete directories, which may be empty.
1998 find "${path}" -type d | sort -r | while read -r dir; do 2036 find "${path}" -type d | sort -r | while read -r dir; do
1999 rmdir "${dir}" 2>/dev/null && einfo "${_CYAN}<<< ${dir}${_NORMAL}" 2037 rmdir "${dir}" 2>/dev/null && echo "${_CYAN}<<< ${dir}${_NORMAL}"
2000 done 2038 done
2001 elif [[ "${path}" == *.py && ! -f "${path}" ]]; then 2039 elif [[ "${path}" == *.py && ! -f "${path}" ]]; then
2002 if [[ (-f "${path}c" || -f "${path}o") ]]; then 2040 if [[ (-f "${path}c" || -f "${path}o") ]]; then
2003 einfo "${_BLUE}<<< ${path}[co]${_NORMAL}" 2041 echo "${_BLUE}<<< ${path}[co]${_NORMAL}"
2004 rm -f "${path}"[co] 2042 rm -f "${path}"[co]
2005 fi 2043 fi
2006 if [[ -f "${path%.py}\$py.class" ]]; then 2044 if [[ -f "${path%.py}\$py.class" ]]; then
2007 einfo "${_BLUE}<<< ${path%.py}\$py.class${_NORMAL}" 2045 echo "${_BLUE}<<< ${path%.py}\$py.class${_NORMAL}"
2008 rm -f "${path%.py}\$py.class" 2046 rm -f "${path%.py}\$py.class"
2009 fi 2047 fi
2010 fi 2048 fi
2011 done 2049 done
2012} 2050}
2027 2065
2028 if [[ "${FUNCNAME[1]}" != "distutils_python_version" ]]; then 2066 if [[ "${FUNCNAME[1]}" != "distutils_python_version" ]]; then
2029 einfo 2067 einfo
2030 einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01." 2068 einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01."
2031 einfo "Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables." 2069 einfo "Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables."
2070 einfo "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
2032 einfo 2071 einfo
2033 fi 2072 fi
2034 2073
2035 [[ -n "${PYVER}" ]] && return 0 2074 [[ -n "${PYVER}" ]] && return 0
2036 local tmpstr 2075 local tmpstr
2064 fi 2103 fi
2065 2104
2066 einfo 2105 einfo
2067 einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01." 2106 einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01."
2068 einfo "Use USE dependencies and/or has_version() instead of ${FUNCNAME}()." 2107 einfo "Use USE dependencies and/or has_version() instead of ${FUNCNAME}()."
2108 einfo "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
2069 einfo 2109 einfo
2070 2110
2071 if [[ "$#" -ne 1 ]]; then 2111 if [[ "$#" -ne 1 ]]; then
2072 die "${FUNCNAME}() requires 1 argument" 2112 die "${FUNCNAME}() requires 1 argument"
2073 fi 2113 fi
2086 2126
2087 if [[ "${FUNCNAME[1]}" != "distutils_python_tkinter" ]]; then 2127 if [[ "${FUNCNAME[1]}" != "distutils_python_tkinter" ]]; then
2088 einfo 2128 einfo
2089 einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01." 2129 einfo "Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01."
2090 einfo "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()." 2130 einfo "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
2131 einfo "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
2091 einfo 2132 einfo
2092 fi 2133 fi
2093 2134
2094 if ! "$(PYTHON ${PYTHON_ABI})" -c "from sys import version_info 2135 if ! "$(PYTHON ${PYTHON_ABI})" -c "from sys import version_info
2095if version_info[0] == 3: 2136if version_info[0] == 3:

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94

  ViewVC Help
Powered by ViewVC 1.1.20