summaryrefslogtreecommitdiff
path: root/eclass/distutils-r1.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-29 10:15:54 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-29 10:15:54 +0100
commit9aa80713372911cec499b3adb2cd746790920916 (patch)
treeb8e99dc5dd60ac2094a27cc52f74aada8df38f05 /eclass/distutils-r1.eclass
parentb4d43e8c611df4a8061b6f88d9e9f6b1e3c83903 (diff)
gentoo resync : 29.06.2021
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass43
1 files changed, 29 insertions, 14 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index cc0416fb1d9e..344aa46b2f94 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -421,7 +421,7 @@ distutils_enable_tests() {
test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
else
test_deps+=" $(python_gen_cond_dep "
- ${test_pkg}[\${PYTHON_MULTI_USEDEP}]
+ ${test_pkg}[\${PYTHON_USEDEP}]
")"
fi
fi
@@ -616,6 +616,20 @@ _distutils-r1_handle_pyproject_toml() {
fi
}
+# @FUNCTION: _distutils-r1_check_all_phase_mismatch
+# @DESCRIPTION:
+# Verify whether *_all phase impls is not called from from non-*_all
+# subphase.
+_distutils-r1_check_all_phase_mismatch() {
+ if has "python_${EBUILD_PHASE}" "${FUNCNAME[@]}"; then
+ eqawarn "QA Notice: distutils-r1_python_${EBUILD_PHASE}_all called"
+ eqawarn "from python_${EBUILD_PHASE}. Did you mean to use"
+ eqawarn "python_${EBUILD_PHASE}_all()?"
+ [[ ${EAPI} != [67] ]] &&
+ die "distutils-r1_python_${EBUILD_PHASE}_all called from python_${EBUILD_PHASE}."
+ fi
+}
+
# @FUNCTION: distutils-r1_python_prepare_all
# @DESCRIPTION:
# The default python_prepare_all(). It applies the patches from PATCHES
@@ -626,6 +640,7 @@ _distutils-r1_handle_pyproject_toml() {
# distutils patches and/or quirks.
distutils-r1_python_prepare_all() {
debug-print-function ${FUNCNAME} "${@}"
+ _distutils-r1_check_all_phase_mismatch
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
default
@@ -740,24 +755,23 @@ distutils-r1_python_compile() {
}
# @FUNCTION: _distutils-r1_wrap_scripts
-# @USAGE: <path> <bindir>
+# @USAGE: <bindir>
# @INTERNAL
# @DESCRIPTION:
# Moves and wraps all installed scripts/executables as necessary.
_distutils-r1_wrap_scripts() {
debug-print-function ${FUNCNAME} "${@}"
- [[ ${#} -eq 2 ]] || die "usage: ${FUNCNAME} <path> <bindir>"
- local path=${1}
- local bindir=${2}
+ [[ ${#} -eq 1 ]] || die "usage: ${FUNCNAME} <bindir>"
+ local bindir=${1}
local scriptdir=$(python_get_scriptdir)
local f python_files=() non_python_files=()
- if [[ -d ${path}${scriptdir} ]]; then
- for f in "${path}${scriptdir}"/*; do
+ if [[ -d ${D%/}${scriptdir} ]]; then
+ for f in "${D%/}${scriptdir}"/*; do
[[ -d ${f} ]] && die "Unexpected directory: ${f}"
- debug-print "${FUNCNAME}: found executable at ${f#${path}/}"
+ debug-print "${FUNCNAME}: found executable at ${f#${D%/}/}"
local shebang
read -r shebang < "${f}"
@@ -769,7 +783,7 @@ _distutils-r1_wrap_scripts() {
non_python_files+=( "${f}" )
fi
- mkdir -p "${path}${bindir}" || die
+ mkdir -p "${D%/}${bindir}" || die
done
for f in "${python_files[@]}"; do
@@ -778,15 +792,15 @@ _distutils-r1_wrap_scripts() {
debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}"
local dosym=dosym
[[ ${EAPI} == [67] ]] && dosym=dosym8
- "${dosym}" -r "${path#${D}}"/usr/lib/python-exec/python-exec2 \
- "${path#${D}}${bindir#${EPREFIX}}/${basename}"
+ "${dosym}" -r /usr/lib/python-exec/python-exec2 \
+ "${bindir#${EPREFIX}}/${basename}"
done
for f in "${non_python_files[@]}"; do
local basename=${f##*/}
- debug-print "${FUNCNAME}: moving ${f#${path}/} to ${bindir}/${basename}"
- mv "${f}" "${path}${bindir}/${basename}" || die
+ debug-print "${FUNCNAME}: moving ${f#${D%/}/} to ${bindir}/${basename}"
+ mv "${f}" "${D%/}${bindir}/${basename}" || die
done
fi
}
@@ -923,8 +937,8 @@ distutils-r1_python_install() {
fi
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- _distutils-r1_wrap_scripts "${root}" "${scriptdir}"
multibuild_merge_root "${root}" "${D%/}"
+ _distutils-r1_wrap_scripts "${scriptdir}"
fi
}
@@ -933,6 +947,7 @@ distutils-r1_python_install() {
# The default python_install_all(). It installs the documentation.
distutils-r1_python_install_all() {
debug-print-function ${FUNCNAME} "${@}"
+ _distutils-r1_check_all_phase_mismatch
einstalldocs
}