--- distutils.eclass +++ distutils.eclass @@ -504,3 +504,26 @@ fi fi } + +# @FUNCTION: distutils_get_intermediate_installation_image +# @DESCRIPTION: +# Print path to intermediate installation image. +# +# This function can be used only in distutils_src_install_pre_hook() and distutils_src_install_post_hook(). +distutils_get_intermediate_installation_image() { + if [[ "${EBUILD_PHASE}" != "install" ]]; then + die "${FUNCNAME}() can be used only in src_install() phase" + fi + + if ! _python_package_supporting_installation_for_multiple_python_abis; then + die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs" + fi + + _python_check_python_pkg_setup_execution + + if [[ ! "${FUNCNAME[1]}" =~ ^distutils_src_install_(pre|post)_hook$ ]]; then + die "${FUNCNAME}() can be used only in distutils_src_install_pre_hook() and distutils_src_install_post_hook()" + fi + + echo "${T}/images/${PYTHON_ABI}" +}