mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 09:26:58 +02:00
eclass/python-utils-r1: Sync with Gentoo
It's from Gentoo commit a575c0dc2baa664156c55c58052b547447eb7ed4.
This commit is contained in:
parent
81bc0dc02d
commit
de806bd054
@ -23,14 +23,14 @@
|
|||||||
# metadata/install-qa-check.d/60python-pyc
|
# metadata/install-qa-check.d/60python-pyc
|
||||||
# See bug #704286, bug #781878
|
# See bug #704286, bug #781878
|
||||||
|
|
||||||
|
if [[ -z ${_PYTHON_UTILS_R1_ECLASS} ]]; then
|
||||||
|
_PYTHON_UTILS_R1_ECLASS=1
|
||||||
|
|
||||||
case ${EAPI} in
|
case ${EAPI} in
|
||||||
7|8) ;;
|
7|8) ;;
|
||||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ ! ${_PYTHON_UTILS_R1_ECLASS} ]]; then
|
|
||||||
_PYTHON_UTILS_R1_ECLASS=1
|
|
||||||
|
|
||||||
[[ ${EAPI} == 7 ]] && inherit eapi8-dosym
|
[[ ${EAPI} == 7 ]] && inherit eapi8-dosym
|
||||||
inherit multiprocessing toolchain-funcs
|
inherit multiprocessing toolchain-funcs
|
||||||
|
|
||||||
@ -41,6 +41,7 @@ inherit multiprocessing toolchain-funcs
|
|||||||
_PYTHON_ALL_IMPLS=(
|
_PYTHON_ALL_IMPLS=(
|
||||||
pypy3
|
pypy3
|
||||||
python3_{10..13}
|
python3_{10..13}
|
||||||
|
python3_13t
|
||||||
)
|
)
|
||||||
readonly _PYTHON_ALL_IMPLS
|
readonly _PYTHON_ALL_IMPLS
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ readonly _PYTHON_HISTORICAL_IMPLS
|
|||||||
# Verify whether the patterns passed to the eclass function are correct
|
# Verify whether the patterns passed to the eclass function are correct
|
||||||
# (i.e. can match any valid implementation). Dies on wrong pattern.
|
# (i.e. can match any valid implementation). Dies on wrong pattern.
|
||||||
_python_verify_patterns() {
|
_python_verify_patterns() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
local impl pattern
|
local impl pattern
|
||||||
for pattern; do
|
for pattern; do
|
||||||
@ -136,7 +137,7 @@ _python_set_impls() {
|
|||||||
# please keep them in sync with _PYTHON_ALL_IMPLS
|
# please keep them in sync with _PYTHON_ALL_IMPLS
|
||||||
# and _PYTHON_HISTORICAL_IMPLS
|
# and _PYTHON_HISTORICAL_IMPLS
|
||||||
case ${i} in
|
case ${i} in
|
||||||
pypy3|python3_9|python3_1[0-3])
|
pypy3|python3_9|python3_1[0-3]|python3_13t)
|
||||||
;;
|
;;
|
||||||
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-9])
|
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-9])
|
||||||
obsolete+=( "${i}" )
|
obsolete+=( "${i}" )
|
||||||
@ -232,7 +233,7 @@ _python_impl_matches() {
|
|||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
3.8|3.9|3.1[1-3])
|
3.8|3.9|3.1[1-3])
|
||||||
[[ ${impl} == python${pattern/./_} ]] && return 0
|
[[ ${impl%t} == python${pattern/./_} ]] && return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# unify value style to allow lax matching
|
# unify value style to allow lax matching
|
||||||
@ -298,7 +299,7 @@ _python_impl_matches() {
|
|||||||
# PYTHON_SITEDIR. They are described more completely in the eclass
|
# PYTHON_SITEDIR. They are described more completely in the eclass
|
||||||
# variable documentation.
|
# variable documentation.
|
||||||
_python_export() {
|
_python_export() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
local impl var
|
local impl var
|
||||||
|
|
||||||
@ -435,7 +436,7 @@ _python_export() {
|
|||||||
or "")
|
or "")
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
val=${PYTHON}${flags}-config
|
val=${PYTHON%t}${flags}-config
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "${impl}: obtaining ${var} not supported"
|
die "${impl}: obtaining ${var} not supported"
|
||||||
@ -483,7 +484,7 @@ _python_export() {
|
|||||||
# Obtain and print the 'stdlib' path for the given implementation. If no
|
# Obtain and print the 'stdlib' path for the given implementation. If no
|
||||||
# implementation is provided, ${EPYTHON} will be used.
|
# implementation is provided, ${EPYTHON} will be used.
|
||||||
python_get_stdlib() {
|
python_get_stdlib() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_STDLIB
|
_python_export "${@}" PYTHON_STDLIB
|
||||||
echo "${PYTHON_STDLIB}"
|
echo "${PYTHON_STDLIB}"
|
||||||
@ -496,7 +497,7 @@ python_get_stdlib() {
|
|||||||
# implementation. If no implementation is provided, ${EPYTHON} will
|
# implementation. If no implementation is provided, ${EPYTHON} will
|
||||||
# be used.
|
# be used.
|
||||||
python_get_sitedir() {
|
python_get_sitedir() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_SITEDIR
|
_python_export "${@}" PYTHON_SITEDIR
|
||||||
echo "${PYTHON_SITEDIR}"
|
echo "${PYTHON_SITEDIR}"
|
||||||
@ -508,7 +509,7 @@ python_get_sitedir() {
|
|||||||
# Obtain and print the include path for the given implementation. If no
|
# Obtain and print the include path for the given implementation. If no
|
||||||
# implementation is provided, ${EPYTHON} will be used.
|
# implementation is provided, ${EPYTHON} will be used.
|
||||||
python_get_includedir() {
|
python_get_includedir() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_INCLUDEDIR
|
_python_export "${@}" PYTHON_INCLUDEDIR
|
||||||
echo "${PYTHON_INCLUDEDIR}"
|
echo "${PYTHON_INCLUDEDIR}"
|
||||||
@ -523,7 +524,7 @@ python_get_includedir() {
|
|||||||
# Please note that this function can be used with CPython only. Use
|
# Please note that this function can be used with CPython only. Use
|
||||||
# in another implementation will result in a fatal failure.
|
# in another implementation will result in a fatal failure.
|
||||||
python_get_library_path() {
|
python_get_library_path() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_LIBPATH
|
_python_export "${@}" PYTHON_LIBPATH
|
||||||
echo "${PYTHON_LIBPATH}"
|
echo "${PYTHON_LIBPATH}"
|
||||||
@ -540,7 +541,7 @@ python_get_library_path() {
|
|||||||
# It requires Python and pkg-config installed, and therefore proper
|
# It requires Python and pkg-config installed, and therefore proper
|
||||||
# build-time dependencies need be added to the ebuild.
|
# build-time dependencies need be added to the ebuild.
|
||||||
python_get_CFLAGS() {
|
python_get_CFLAGS() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_CFLAGS
|
_python_export "${@}" PYTHON_CFLAGS
|
||||||
echo "${PYTHON_CFLAGS}"
|
echo "${PYTHON_CFLAGS}"
|
||||||
@ -557,7 +558,7 @@ python_get_CFLAGS() {
|
|||||||
# It requires Python and pkg-config installed, and therefore proper
|
# It requires Python and pkg-config installed, and therefore proper
|
||||||
# build-time dependencies need be added to the ebuild.
|
# build-time dependencies need be added to the ebuild.
|
||||||
python_get_LIBS() {
|
python_get_LIBS() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_LIBS
|
_python_export "${@}" PYTHON_LIBS
|
||||||
echo "${PYTHON_LIBS}"
|
echo "${PYTHON_LIBS}"
|
||||||
@ -574,7 +575,7 @@ python_get_LIBS() {
|
|||||||
# It requires Python installed, and therefore proper build-time
|
# It requires Python installed, and therefore proper build-time
|
||||||
# dependencies need be added to the ebuild.
|
# dependencies need be added to the ebuild.
|
||||||
python_get_PYTHON_CONFIG() {
|
python_get_PYTHON_CONFIG() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_CONFIG
|
_python_export "${@}" PYTHON_CONFIG
|
||||||
echo "${PYTHON_CONFIG}"
|
echo "${PYTHON_CONFIG}"
|
||||||
@ -587,7 +588,7 @@ python_get_PYTHON_CONFIG() {
|
|||||||
# implementation. If no implementation is provided, ${EPYTHON} will
|
# implementation. If no implementation is provided, ${EPYTHON} will
|
||||||
# be used.
|
# be used.
|
||||||
python_get_scriptdir() {
|
python_get_scriptdir() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_export "${@}" PYTHON_SCRIPTDIR
|
_python_export "${@}" PYTHON_SCRIPTDIR
|
||||||
echo "${PYTHON_SCRIPTDIR}"
|
echo "${PYTHON_SCRIPTDIR}"
|
||||||
@ -600,7 +601,7 @@ python_get_scriptdir() {
|
|||||||
# paths). If no directories are provided, the default system paths
|
# paths). If no directories are provided, the default system paths
|
||||||
# are used (prepended with ${D}).
|
# are used (prepended with ${D}).
|
||||||
python_optimize() {
|
python_optimize() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
|
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
|
||||||
|
|
||||||
@ -617,8 +618,8 @@ python_optimize() {
|
|||||||
# 2) skip paths which do not exist
|
# 2) skip paths which do not exist
|
||||||
# (python2.6 complains about them verbosely)
|
# (python2.6 complains about them verbosely)
|
||||||
|
|
||||||
if [[ ${f} == /* && -d ${D%/}${f} ]]; then
|
if [[ ${f} == /* && -d ${D}${f} ]]; then
|
||||||
set -- "${D%/}${f}" "${@}"
|
set -- "${D}${f}" "${@}"
|
||||||
fi
|
fi
|
||||||
done < <(
|
done < <(
|
||||||
"${PYTHON}" - <<-EOF || die
|
"${PYTHON}" - <<-EOF || die
|
||||||
@ -634,7 +635,7 @@ python_optimize() {
|
|||||||
local d
|
local d
|
||||||
for d; do
|
for d; do
|
||||||
# make sure to get a nice path without //
|
# make sure to get a nice path without //
|
||||||
local instpath=${d#${D%/}}
|
local instpath=${d#${D}}
|
||||||
instpath=/${instpath##/}
|
instpath=/${instpath##/}
|
||||||
|
|
||||||
einfo "Optimize Python modules for ${instpath}"
|
einfo "Optimize Python modules for ${instpath}"
|
||||||
@ -677,7 +678,7 @@ python_optimize() {
|
|||||||
# }
|
# }
|
||||||
# @CODE
|
# @CODE
|
||||||
python_scriptinto() {
|
python_scriptinto() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_PYTHON_SCRIPTROOT=${1}
|
_PYTHON_SCRIPTROOT=${1}
|
||||||
}
|
}
|
||||||
@ -691,7 +692,7 @@ python_scriptinto() {
|
|||||||
# The executable will be wrapped properly for the Python implementation,
|
# The executable will be wrapped properly for the Python implementation,
|
||||||
# though no shebang mangling will be performed.
|
# though no shebang mangling will be performed.
|
||||||
python_doexe() {
|
python_doexe() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EBUILD_PHASE} != install ]] &&
|
[[ ${EBUILD_PHASE} != install ]] &&
|
||||||
die "${FUNCNAME} can only be used in src_install"
|
die "${FUNCNAME} can only be used in src_install"
|
||||||
@ -712,7 +713,7 @@ python_doexe() {
|
|||||||
# though no shebang mangling will be performed. It will be renamed
|
# though no shebang mangling will be performed. It will be renamed
|
||||||
# to <new-name>.
|
# to <new-name>.
|
||||||
python_newexe() {
|
python_newexe() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EBUILD_PHASE} != install ]] &&
|
[[ ${EBUILD_PHASE} != install ]] &&
|
||||||
die "${FUNCNAME} can only be used in src_install"
|
die "${FUNCNAME} can only be used in src_install"
|
||||||
@ -741,7 +742,7 @@ python_newexe() {
|
|||||||
|
|
||||||
# don't use this at home, just call python_doscript() instead
|
# don't use this at home, just call python_doscript() instead
|
||||||
if [[ ${_PYTHON_REWRITE_SHEBANG} ]]; then
|
if [[ ${_PYTHON_REWRITE_SHEBANG} ]]; then
|
||||||
python_fix_shebang -q "${ED%/}/${d}/${newfn}"
|
python_fix_shebang -q "${ED}${d}/${newfn}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,7 +763,7 @@ python_newexe() {
|
|||||||
# }
|
# }
|
||||||
# @CODE
|
# @CODE
|
||||||
python_doscript() {
|
python_doscript() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EBUILD_PHASE} != install ]] &&
|
[[ ${EBUILD_PHASE} != install ]] &&
|
||||||
die "${FUNCNAME} can only be used in src_install"
|
die "${FUNCNAME} can only be used in src_install"
|
||||||
@ -789,7 +790,7 @@ python_doscript() {
|
|||||||
# }
|
# }
|
||||||
# @CODE
|
# @CODE
|
||||||
python_newscript() {
|
python_newscript() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EBUILD_PHASE} != install ]] &&
|
[[ ${EBUILD_PHASE} != install ]] &&
|
||||||
die "${FUNCNAME} can only be used in src_install"
|
die "${FUNCNAME} can only be used in src_install"
|
||||||
@ -827,7 +828,7 @@ python_newscript() {
|
|||||||
# }
|
# }
|
||||||
# @CODE
|
# @CODE
|
||||||
python_moduleinto() {
|
python_moduleinto() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_PYTHON_MODULEROOT=${1}
|
_PYTHON_MODULEROOT=${1}
|
||||||
}
|
}
|
||||||
@ -852,7 +853,7 @@ python_moduleinto() {
|
|||||||
# }
|
# }
|
||||||
# @CODE
|
# @CODE
|
||||||
python_domodule() {
|
python_domodule() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
|
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
|
||||||
|
|
||||||
@ -872,15 +873,15 @@ python_domodule() {
|
|||||||
insinto "${d}"
|
insinto "${d}"
|
||||||
doins -r "${@}" || return ${?}
|
doins -r "${@}" || return ${?}
|
||||||
)
|
)
|
||||||
python_optimize "${ED%/}/${d}"
|
python_optimize "${ED}${d}"
|
||||||
elif [[ -n ${BUILD_DIR} ]]; then
|
elif [[ -n ${BUILD_DIR} ]]; then
|
||||||
local dest=${BUILD_DIR}/install${EPREFIX}/${d}
|
local dest=${BUILD_DIR}/install${EPREFIX}/${d}
|
||||||
mkdir -p "${dest}" || die
|
mkdir -p "${dest}" || die
|
||||||
cp -pR "${@}" "${dest}/" || die
|
cp -pR "${@}" "${dest}/" || die
|
||||||
(
|
(
|
||||||
cd "${dest}" &&
|
cd "${dest}" || die
|
||||||
chmod -R a+rX "${@##*/}"
|
chmod -R a+rX "${@##*/}" || die
|
||||||
) || die
|
)
|
||||||
else
|
else
|
||||||
die "${FUNCNAME} can only be used in src_install or with BUILD_DIR set"
|
die "${FUNCNAME} can only be used in src_install or with BUILD_DIR set"
|
||||||
fi
|
fi
|
||||||
@ -900,7 +901,7 @@ python_domodule() {
|
|||||||
# }
|
# }
|
||||||
# @CODE
|
# @CODE
|
||||||
python_doheader() {
|
python_doheader() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EBUILD_PHASE} != install ]] &&
|
[[ ${EBUILD_PHASE} != install ]] &&
|
||||||
die "${FUNCNAME} can only be used in src_install"
|
die "${FUNCNAME} can only be used in src_install"
|
||||||
@ -932,7 +933,7 @@ python_doheader() {
|
|||||||
# setup will be done. If wrapper update is requested, the directory
|
# setup will be done. If wrapper update is requested, the directory
|
||||||
# shall be removed first.
|
# shall be removed first.
|
||||||
_python_wrapper_setup() {
|
_python_wrapper_setup() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
local workdir=${1:-${T}/${EPYTHON}}
|
local workdir=${1:-${T}/${EPYTHON}}
|
||||||
local impl=${2:-${EPYTHON}}
|
local impl=${2:-${EPYTHON}}
|
||||||
@ -1034,7 +1035,7 @@ _python_wrapper_setup() {
|
|||||||
# Python version (but not non-Python shebangs). --quiet causes
|
# Python version (but not non-Python shebangs). --quiet causes
|
||||||
# the function not to list modified files verbosely.
|
# the function not to list modified files verbosely.
|
||||||
python_fix_shebang() {
|
python_fix_shebang() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${EPYTHON} ]] || die "${FUNCNAME}: EPYTHON unset (pkg_setup not called?)"
|
[[ ${EPYTHON} ]] || die "${FUNCNAME}: EPYTHON unset (pkg_setup not called?)"
|
||||||
|
|
||||||
@ -1103,17 +1104,17 @@ python_fix_shebang() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! ${quiet} ]]; then
|
if [[ ! ${quiet} ]]; then
|
||||||
einfo "Fixing shebang in ${f#${D%/}}."
|
einfo "Fixing shebang in ${f#${D}}."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! ${error} ]]; then
|
if [[ ! ${error} ]]; then
|
||||||
debug-print "${FUNCNAME}: in file ${f#${D%/}}"
|
debug-print "${FUNCNAME}: in file ${f#${D}}"
|
||||||
debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
|
debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
|
||||||
sed -i -e "1s@${from}@#!${EPREFIX}/usr/bin/${EPYTHON}@" "${f}" || die
|
sed -i -e "1s@${from}@#!${EPREFIX}/usr/bin/${EPYTHON}@" "${f}" || die
|
||||||
any_fixed=1
|
any_fixed=1
|
||||||
else
|
else
|
||||||
eerror "The file has incompatible shebang:"
|
eerror "The file has incompatible shebang:"
|
||||||
eerror " file: ${f#${D%/}}"
|
eerror " file: ${f#${D}}"
|
||||||
eerror " current shebang: ${shebang}"
|
eerror " current shebang: ${shebang}"
|
||||||
eerror " requested impl: ${EPYTHON}"
|
eerror " requested impl: ${EPYTHON}"
|
||||||
die "${FUNCNAME}: conversion of incompatible shebang requested"
|
die "${FUNCNAME}: conversion of incompatible shebang requested"
|
||||||
@ -1121,7 +1122,7 @@ python_fix_shebang() {
|
|||||||
done < <(find -H "${path}" -type f -print0 || die)
|
done < <(find -H "${path}" -type f -print0 || die)
|
||||||
|
|
||||||
if [[ ! ${any_fixed} ]]; then
|
if [[ ! ${any_fixed} ]]; then
|
||||||
eerror "QA error: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
|
eerror "QA error: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
|
||||||
eerror "There are no Python files in specified directory."
|
eerror "There are no Python files in specified directory."
|
||||||
die "${FUNCNAME} did not match any fixable files"
|
die "${FUNCNAME} did not match any fixable files"
|
||||||
fi
|
fi
|
||||||
@ -1154,7 +1155,7 @@ _python_check_locale_sanity() {
|
|||||||
# nothing if LC_ALL is defined, or if the current locale uses a UTF-8 charmap.
|
# nothing if LC_ALL is defined, or if the current locale uses a UTF-8 charmap.
|
||||||
# This may be used to work around the quirky open() behavior of python3.
|
# This may be used to work around the quirky open() behavior of python3.
|
||||||
python_export_utf8_locale() {
|
python_export_utf8_locale() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
# If the locale program isn't available, just return.
|
# If the locale program isn't available, just return.
|
||||||
type locale &>/dev/null || return 0
|
type locale &>/dev/null || return 0
|
||||||
@ -1206,7 +1207,7 @@ python_export_utf8_locale() {
|
|||||||
# to be taken to run einstalldocs from the same directory
|
# to be taken to run einstalldocs from the same directory
|
||||||
# (usually ${S}).
|
# (usually ${S}).
|
||||||
build_sphinx() {
|
build_sphinx() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: <directory>"
|
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: <directory>"
|
||||||
|
|
||||||
local dir=${1}
|
local dir=${1}
|
||||||
@ -1252,7 +1253,7 @@ _python_check_EPYTHON() {
|
|||||||
# package sources that would block installed packages from being used
|
# package sources that would block installed packages from being used
|
||||||
# (and effectively e.g. make it impossible to load compiled extensions).
|
# (and effectively e.g. make it impossible to load compiled extensions).
|
||||||
_python_check_occluded_packages() {
|
_python_check_occluded_packages() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ -z ${BUILD_DIR} || ! -d ${BUILD_DIR}/install ]] && return
|
[[ -z ${BUILD_DIR} || ! -d ${BUILD_DIR}/install ]] && return
|
||||||
|
|
||||||
@ -1362,7 +1363,7 @@ _python_check_occluded_packages() {
|
|||||||
#
|
#
|
||||||
# This command dies on failure and respects nonfatal.
|
# This command dies on failure and respects nonfatal.
|
||||||
epytest() {
|
epytest() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_check_EPYTHON
|
_python_check_EPYTHON
|
||||||
_python_check_occluded_packages
|
_python_check_occluded_packages
|
||||||
@ -1490,7 +1491,7 @@ epytest() {
|
|||||||
#
|
#
|
||||||
# This command dies on failure and respects nonfatal.
|
# This command dies on failure and respects nonfatal.
|
||||||
eunittest() {
|
eunittest() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
_python_check_EPYTHON
|
_python_check_EPYTHON
|
||||||
_python_check_occluded_packages
|
_python_check_occluded_packages
|
||||||
@ -1515,7 +1516,7 @@ eunittest() {
|
|||||||
# code. Checks whether the interpreter is installed, runs
|
# code. Checks whether the interpreter is installed, runs
|
||||||
# python_check_deps() if declared.
|
# python_check_deps() if declared.
|
||||||
_python_run_check_deps() {
|
_python_run_check_deps() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
local impl=${1}
|
local impl=${1}
|
||||||
|
|
||||||
@ -1547,7 +1548,7 @@ _python_run_check_deps() {
|
|||||||
# The wrapper accepts multiple package specifications. For the check
|
# The wrapper accepts multiple package specifications. For the check
|
||||||
# to succeed, *all* specified atoms must match.
|
# to succeed, *all* specified atoms must match.
|
||||||
python_has_version() {
|
python_has_version() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
local root_arg=( -b )
|
local root_arg=( -b )
|
||||||
case ${1} in
|
case ${1} in
|
||||||
@ -1572,7 +1573,7 @@ python_has_version() {
|
|||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Perform additional environment sanity checks.
|
# Perform additional environment sanity checks.
|
||||||
_python_sanity_checks() {
|
_python_sanity_checks() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
[[ ${_PYTHON_SANITY_CHECKED} ]] && return
|
[[ ${_PYTHON_SANITY_CHECKED} ]] && return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user