As noticed in bug 420579, the updated code in distutils-r1 tries to symlink python-exec from outside of EPREFIX. However, looking at the code I'm starting to think it would even install the whole package ignoring EPREFIX. Does Prefix Portage have some auto-fixing for that or am I missing something? The relevant code pieces: distutils-r1_python_install() { # [...] local root=${D}/_${EPYTHON} esetup.py install "${flags[@]}" --root="${root}" "${@}" _distutils-r1_rename_scripts "${root}" # merge cp -a -l -n "${root}"/* "${D}"/ || die "Merging ${EPYTHON} image failed." rm -rf "${root}" } ...so assuming that the package would land in $D/_python2.7/usr/bin/flaggie-python2.7, then get copied to $D/usr/bin/... ...or am I missing something?
My personal observation was that _python_ln_rel from python-utils-r1 is adding too many ../ pairs because it takes the EPREFIX into account, which it shouldn't, or it'll point beyond the prefix entry point. For that case a simple X -> python-exec symlink would've been sufficient.
(In reply to comment #1) > My personal observation was that _python_ln_rel from python-utils-r1 is > adding too many ../ pairs because it takes the EPREFIX into account, which > it shouldn't, or it'll point beyond the prefix entry point. > > For that case a simple X -> python-exec symlink would've been sufficient. I'm afraid I don't understand you. _python_ln_rel just works on two absolute paths, and it isn't Prefix-aware by itself. The distutils-r1 functions should be (but aren't) as I pointed out. However, I don't want to change them without making sure that I understand it all correctly. I've added two elog lines to the find loop in distutils_rename_scripts like: while IFS= read -r -d '' f; do debug-print "${FUNCNAME}: found executable at ${f#${D}/}" elog "$f" elog "$path/usr/bin/python-exec" and they give for me: * /tmp/portage/app-portage/flaggie-0.2-r2/image//_python2.6/usr/bin/flaggie * /tmp/portage/app-portage/flaggie-0.2-r2/image//_python2.6/usr/bin/python-exec * /tmp/portage/app-portage/flaggie-0.2-r2/image//_python3.1/usr/bin/flaggie * /tmp/portage/app-portage/flaggie-0.2-r2/image//_python3.1/usr/bin/python-exec * /tmp/portage/app-portage/flaggie-0.2-r2/image//_python3.2/usr/bin/flaggie * /tmp/portage/app-portage/flaggie-0.2-r2/image//_python3.2/usr/bin/python-exec I'd assume the output for Prefix portage would be the same, unless I'm missing something hidden.
* /Library/Gentoo/var/tmp/portage/app-portage/flaggie-0.2-r2/image//_python2.7/Library/Gentoo/usr/bin/flaggie * /Library/Gentoo/var/tmp/portage/app-portage/flaggie-0.2-r2/image//_python2.7/usr/bin/python-exec so, the esetup.py stuff adds (correctly) the full installation prefix (/usr in your case) Hence, seems we can solve it by Index: distutils-r1.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v retrieving revision 1.30 diff -u -r1.30 distutils-r1.eclass --- distutils-r1.eclass 7 Dec 2012 22:23:04 -0000 1.30 +++ distutils-r1.eclass 9 Dec 2012 20:22:48 -0000 @@ -295,7 +295,7 @@ mv "${f}" "${newf}" || die debug-print "${FUNCNAME}: installing wrapper at ${f#${D}/}" - _python_ln_rel "${path}"/usr/bin/python-exec "${f}" || die + _python_ln_rel "${path}${EPREFIX}"/usr/bin/python-exec "${f}" || die fi done < <(find "${path}" -type f -executable -print0) } which results in the symlink: flaggie -> python-exec
(In reply to comment #3) > * > /Library/Gentoo/var/tmp/portage/app-portage/flaggie-0.2-r2/image//_python2.7/ > Library/Gentoo/usr/bin/flaggie > * > /Library/Gentoo/var/tmp/portage/app-portage/flaggie-0.2-r2/image//_python2.7/ > usr/bin/python-exec > > so, the esetup.py stuff adds (correctly) the full installation prefix (/usr > in your case) Ah, yes, I get it. > Hence, seems we can solve it by > > Index: distutils-r1.eclass > =================================================================== > RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v > retrieving revision 1.30 > diff -u -r1.30 distutils-r1.eclass > --- distutils-r1.eclass 7 Dec 2012 22:23:04 -0000 1.30 > +++ distutils-r1.eclass 9 Dec 2012 20:22:48 -0000 > @@ -295,7 +295,7 @@ > mv "${f}" "${newf}" || die > > debug-print "${FUNCNAME}: installing wrapper at > ${f#${D}/}" > - _python_ln_rel "${path}"/usr/bin/python-exec "${f}" > || die > + _python_ln_rel > "${path}${EPREFIX}"/usr/bin/python-exec "${f}" || die > fi > done < <(find "${path}" -type f -executable -print0) > } > > which results in the symlink: > > flaggie -> python-exec Indeed. Thanks for the help.
/var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v <-- distutils-r1.eclass new revision: 1.31; previous revision: 1.30