Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 361402 Details for
Bug 487788
distutils-r1.eclass: distutils-r1_python_install does not support overriding scriptdir (was: games-board/pychess)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch rev1
0001-distutils-r1-parse-handle-custom-install-scripts.patch (text/plain), 3.41 KB, created by
Michał Górny
on 2013-10-20 06:34:33 UTC
(
hide
)
Description:
Patch rev1
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2013-10-20 06:34:33 UTC
Size:
3.41 KB
patch
obsolete
>From e76753b47f13fba670da0c2a794ce46224013eb8 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> >Date: Sun, 20 Oct 2013 00:11:46 +0200 >Subject: [PATCH] distutils-r1: parse & handle custom --install-scripts. > >Some ebuilds don't like the sane defaults and like to override >--install-scripts. Parse that argument in order to obtain the requested >install dir, and place the wrapper there. > >Fixes: https://bugs.gentoo.org/show_bug.cgi?id=487788 >--- > eclass/distutils-r1.eclass | 40 ++++++++++++++++++++++++++++++---------- > 1 file changed, 30 insertions(+), 10 deletions(-) > >diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass >index acc791b..9ede335 100644 >--- a/eclass/distutils-r1.eclass >+++ b/eclass/distutils-r1.eclass >@@ -407,21 +407,21 @@ distutils-r1_python_test() { > } > > # @FUNCTION: _distutils-r1_wrap_scripts >-# @USAGE: <path> >+# @USAGE: <path> <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} >- [[ ${path} ]] || die "${FUNCNAME}: no path given" >+ local bindir=${2} > > if ! _python_want_python_exec2; then >- local PYTHON_SCRIPTDIR=${EPREFIX}/usr/bin >+ local PYTHON_SCRIPTDIR=${bindir} > fi > >- mkdir -p "${path}${EPREFIX}/usr/bin" || die > local f > while IFS= read -r -d '' f; do > local basename=${f##*/} >@@ -429,6 +429,7 @@ _distutils-r1_wrap_scripts() { > > [[ -d ${f} ]] && die "Unexpected directory: ${f}" > >+ mkdir -p "${path}${bindir}" || die > local shebang > read -r shebang < "${f}" > if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then >@@ -440,14 +441,14 @@ _distutils-r1_wrap_scripts() { > mv "${f}" "${newf}" || die > fi > >- debug-print "${FUNCNAME}: installing wrapper at /usr/bin/${basename}" >+ debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}" > _python_ln_rel "${path}${EPREFIX}"$(_python_get_wrapper_path) \ >- "${path}${EPREFIX}/usr/bin/${basename}" || die >+ "${path}${bindir}/${basename}" || die > elif _python_want_python_exec2; then > debug-print "${FUNCNAME}: non-matching shebang: ${shebang}" > >- debug-print "${FUNCNAME}: moving to /usr/bin/${basename}" >- mv "${f}" "${path}${EPREFIX}/usr/bin/${basename}" || die >+ debug-print "${FUNCNAME}: moving to ${bindir}/${basename}" >+ mv "${f}" "${path}${bindir}/${basename}" || die > fi > done < <(find "${path}${PYTHON_SCRIPTDIR}" -mindepth 1 -print0) > } >@@ -491,14 +492,33 @@ distutils-r1_python_install() { > flags+=( --install-scripts="${PYTHON_SCRIPTDIR}" ) > fi > >- esetup.py install "${flags[@]}" "${@}" >+ esetup.py install "${@}" "${flags[@]}" > > if [[ -d ${root}$(python_get_sitedir)/tests ]]; then > die "Package installs 'tests' package, file collisions likely." > fi > > if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then >- _distutils-r1_wrap_scripts "${root}" >+ # user may override --install-scripts >+ # note: this is poor but distutils argv parsing is dumb >+ local scriptdir=${EPREFIX}/usr/bin >+ set -- "${mydistutilsargs[@]}" "${@}" >+ while [[ ${@} ]]; do >+ local a=${1} >+ shift >+ >+ case "${a}" in >+ --install-scripts=*) >+ scriptdir=${a#--install-scripts=} >+ ;; >+ --install-scripts) >+ scriptdir=${1} >+ shift >+ ;; >+ esac >+ done >+ >+ _distutils-r1_wrap_scripts "${root}" "${scriptdir}" > multibuild_merge_root "${root}" "${D}" > fi > } >-- >1.8.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 487788
: 361402