• [gentoo-dev] [PATCH 2/5] multibuild.eclass: Provide run_in_build_dir fr

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sun Jan 1 17:10:02 2023
    Remove the duplicate definition of run_in_build_dir() function
    and inherit out-of-source-utils to retain it for compatibility with
    the existing ebuilds in EAPIs 6, 7 and 8. In future EAPIs, the ebuilds
    needing it will inherit out-of-source-utils directly.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/multibuild.eclass | 25 ++++---------------------
    1 file changed, 4 insertions(+), 21 deletions(-)

    diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
    index 7ae03adbe18c..37d6ff104f2e 100644
    --- a/eclass/multibuild.eclass
    +++ b/eclass/multibuild.eclass
    @@ -14,7 +14,10 @@
    # implementations).

    case ${EAPI} in
    - 6|7|8) ;;
    + 6|7|8)
    + # backwards compatibility for run_in_build_dir
    + inherit out-of-source-utils
    + ;;
    *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
    esac

    @@ -175,26 +178,6 @@ multibuild_copy_sources() {
    multibuild_foreach_variant _multibuild_create_source_copy
    }

    -# @FUNCTION: run_in_build_dir
    -# @USAGE: <argv>...
    -# @DESCRIPTION:
    -# Run the given command in the directory pointed by BUILD_DIR. -run_in_build_dir() {
    - debug-print-function ${FUNCNAME} "${@}"
    - local ret
    -
    - [[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified."
    - [[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set."
    -
    - mkdir -p "${BUILD_DIR}" || di