diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-06-25 21:42:37 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-06-29 08:04:56 +0200 |
commit | 7e33b5a5b6f260d72e01591db3978ec8923b298d (patch) | |
tree | 5e9a237dbcad7e9216999067f8ce29185adc39eb /eclass | |
parent | distutils-r1.eclass: Defer wrapping scripts until after root-merge (diff) | |
download | gentoo-7e33b5a5b6f260d72e01591db3978ec8923b298d.tar.gz gentoo-7e33b5a5b6f260d72e01591db3978ec8923b298d.tar.bz2 gentoo-7e33b5a5b6f260d72e01591db3978ec8923b298d.zip |
distutils-r1.eclass: Eliminate path arg to ..._wrap_scripts
Eliminate the path argument to _distutils-r1_wrap_scripts, and inline
the use of ${D} instead. This should make the code less confusing.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 33608eb9fcc9..3d50cd5a2f23 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -740,24 +740,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,22 +768,22 @@ _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 local basename=${f##*/} debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}" - _python_ln_rel "${path}${EPREFIX}"/usr/lib/python-exec/python-exec2 \ - "${path}${bindir}/${basename}" || die + _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \ + "${D%/}${bindir}/${basename}" || die 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 } @@ -922,7 +921,7 @@ distutils-r1_python_install() { if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then multibuild_merge_root "${root}" "${D%/}" - _distutils-r1_wrap_scripts "${D%/}" "${scriptdir}" + _distutils-r1_wrap_scripts "${scriptdir}" fi } |