• [gentoo-dev] [PATCH 11/18] python-utils-r1.eclass: Add explicit checks

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jun 4 11:10:01 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 13 +++++++++++++
    1 file changed, 13 insertions(+)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index fd04cf374ce4..b9cf9c03caeb 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -696,6 +696,9 @@ python_scriptinto() {
    python_doexe() {
    debug-print-function ${FUNCNAME} "${@}"

    + [[ ${EBUILD_PHASE} != install ]] &&
    + die "${FUNCNAME} can only be used in src_install"
    +
    local f
    for f; do
    python_newexe "${f}" "${f##*/}"
    @@ -714,6 +717,8 @@ python_doexe() {
    python_newexe() {
    debug-print-function ${FUNCNAME} "${@}"

    + [[ ${EBUILD_PHASE} != install ]] &&
    + die "${FUNCNAME} can only be used in src_install"
    [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
    [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>"

    @@ -762,6 +767,9 @@ python_newexe() {
    python_doscript() {
    debug-print-function ${FUNCNAME} "${@}"

    + [[ ${EBUILD_PHASE} != instal