diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-06-07 17:41:48 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-06-08 09:53:49 +0200 |
commit | 92ae438f4a64a82591bb0002c29c70985b744d0d (patch) | |
tree | 16ddaecbefa336a513fb5c08233bf14402e71e89 /eclass | |
parent | distutils-r1.eclass: Future-proof python_install() for empty root (diff) | |
download | gentoo-92ae438f4a64a82591bb0002c29c70985b744d0d.tar.gz gentoo-92ae438f4a64a82591bb0002c29c70985b744d0d.tar.bz2 gentoo-92ae438f4a64a82591bb0002c29c70985b744d0d.zip |
distutils-r1.eclass: Move python_optimize call to post-install
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 370b8bb7c6e0..9293f744c7c2 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1558,11 +1558,6 @@ distutils-r1_python_install() { if [[ ${merge_root} ]]; then multibuild_merge_root "${root}" "${D%/}" - if [[ ${DISTUTILS_USE_PEP517} ]]; then - # we need to recompile everything here in order to embed - # the correct paths - python_optimize "${D%/}$(python_get_sitedir)" - fi fi if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then _distutils-r1_wrap_scripts "${scriptdir}" @@ -1858,16 +1853,25 @@ distutils-r1_src_test() { _distutils-r1_post_python_install() { debug-print-function ${FUNCNAME} "${@}" - local forbidden_package_names=( - examples test tests - .pytest_cache .hypothesis _trial_temp - ) - local p - for p in "${forbidden_package_names[@]}"; do - if [[ -d ${D}$(python_get_sitedir)/${p} ]]; then - die "Package installs '${p}' package which is forbidden and likely a bug in the build system." + local sitedir=${D%/}$(python_get_sitedir) + if [[ -d ${sitedir} ]]; then + local forbidden_package_names=( + examples test tests + .pytest_cache .hypothesis _trial_temp + ) + local p + for p in "${forbidden_package_names[@]}"; do + if [[ -d ${sitedir}/${p} ]]; then + die "Package installs '${p}' package which is forbidden and likely a bug in the build system." + fi + done + + if [[ ${DISTUTILS_USE_PEP517} ]]; then + # we need to recompile everything here in order to embed + # the correct paths + python_optimize "${sitedir}" fi - done + fi } # @FUNCTION: _distutils-r1_check_namespace_pth |