The prefix support are implemented as 1. Letting binutils-config-3 be aware of EPREFIX. 2. Eprefixity binutils-config-3 from the ebuild. Reproducible: Always
Created attachment 390898 [details, diff] binutils-config-3.patch Patch for binutils-config-3.
Created attachment 391794 [details, diff] Patch for binutils-config-4 Here's a version for binutils-config-4 with two minor bugs fixed.
Thanks, two comments: argv0=${0##*/} -source /etc/init.d/functions.sh || { - echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2 +source "@GENTOO_PORTAGE_EPREFIX@"/etc/init.d/functions.sh || { + echo "${argv0}: Could not source @GENTOO_PORTAGE_EPREFIX@/etc/init.d/functions.sh!" 1>&2 exit 1 } esyslog() { :; } EPREFIX has already been defined in the beginning. Let's use EPREFIX in place of @GENTOO_PORTAGE_EPREFIX@ here. @@ -96,14 +102,14 @@ setup_env() { # Newer paths: /usr/${HOST}/${TARGET}/... # Older paths: /usr/${TARGET}/... # - if [[ -d ${ROOT}/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then - BINPATH=/usr/${HOST}/${TARGET}/binutils-bin/${VER} - BINPATH_LINKS=/usr/libexec/gcc/${TARGET} + if [[ -d ${ROOT}${EPREFIX}/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then + BINPATH="${EPREFIX}"/usr/${HOST}/${TARGET}/binutils-bin/${VER} + BINPATH_LINKS="${EPREFIX}"/usr/libexec/gcc/${TARGET} fi ${ROOT}${EPREFIX}, EROOT please.
(In reply to Benda Xu from comment #3) > Thanks, two comments: > > argv0=${0##*/} > -source /etc/init.d/functions.sh || { > - echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2 > +source "@GENTOO_PORTAGE_EPREFIX@"/etc/init.d/functions.sh || { > + echo "${argv0}: Could not source > @GENTOO_PORTAGE_EPREFIX@/etc/init.d/functions.sh!" 1>&2 > exit 1 > } > esyslog() { :; } > > EPREFIX has already been defined in the beginning. Let's use EPREFIX in > place of @GENTOO_PORTAGE_EPREFIX@ here. $EPREFIX is the location binutils-config operates on, which can be set by envvar and need not match the location at which it is installed. Just like you can set ROOT to let binutils-config manage a binutils installation at $ROOT, so can you set EPREFIX to manage a binutils in a different prefix. The location of functions.sh, however, is based on the location in which binutils-config is installed. > @@ -96,14 +102,14 @@ setup_env() { > # Newer paths: /usr/${HOST}/${TARGET}/... > # Older paths: /usr/${TARGET}/... > # > - if [[ -d ${ROOT}/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then > - BINPATH=/usr/${HOST}/${TARGET}/binutils-bin/${VER} > - BINPATH_LINKS=/usr/libexec/gcc/${TARGET} > + if [[ -d ${ROOT}${EPREFIX}/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; > then > + BINPATH="${EPREFIX}"/usr/${HOST}/${TARGET}/binutils-bin/${VER} > + BINPATH_LINKS="${EPREFIX}"/usr/libexec/gcc/${TARGET} > fi > > ${ROOT}${EPREFIX}, EROOT please. I prefer the clear relation between the check and the envvar in my version, but whatever floats your boat.
Comment on attachment 391794 [details, diff] Patch for binutils-config-4 >+: ${EPREFIX:="@GENTOO_PORTAGE_EPREFIX@"} >+[[ ${EPREFIX} = */ ]] && EPREFIX="${EPREFIX%/}" >+[[ -n ${EPREFIX} && ${EPREFIX} != /* ]] && EPREFIX="${PWD%/}/${EPREFIX}" the script should be usable as-is ... it shouldn't need to be installed first you can look at the header of gcc-config to see how we handle that there
Created attachment 434942 [details, diff] binutils-config-5.patch Hi Mike. I have updated the patch according to your comments. Please review.
(In reply to Benda Xu from comment #6) looks fine; feel free to commit
Thanks Mike, pushed with eprefixity in the latest ebuild: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62c75f76eb70
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35db5bfb5ce3af08ad8181c657a7b4f81c9dfe3b commit 35db5bfb5ce3af08ad8181c657a7b4f81c9dfe3b Author: Benda Xu <heroxbd@gentoo.org> AuthorDate: 2018-04-13 03:56:34 +0000 Commit: Benda Xu <heroxbd@gentoo.org> CommitDate: 2018-04-13 03:59:56 +0000 sys-devel/binutils-config: revert accidental commit in 62c75f76eb. I have made a mistake to overwrite changes to binutils-config-5. Suggested-By: slyfox Bug: https://bugs.gentoo.org/531616 Bug: https://bugs.gentoo.org/562460 Package-Manager: Portage-2.3.28, Repoman-2.3.9 sys-devel/binutils-config/files/binutils-config-5 | 15 ++++++++++++--- sys-devel/binutils-config/files/binutils-config-5.1 | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-)}