Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 665270 - app-shells/autojump: fix path for Prefix
Summary: app-shells/autojump: fix path for Prefix
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matt Turner
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-09-05 12:34 UTC by Pengcheng Xu
Modified: 2019-04-11 08:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
autojump-ebuild.patch (file_665270.txt,419 bytes, patch)
2018-09-05 12:34 UTC, Pengcheng Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pengcheng Xu 2018-09-05 12:34:43 UTC
Created attachment 545976 [details, diff]
autojump-ebuild.patch

A patch to the ebuild for embedding $EPREFIX in ${EPREFIX}/etc/profile.d/autojump.sh has been added.

Seems related to #465226, but the proposed change in that version is missing in the tree, and as startprefix no longer exports EPREFIX, writing "${EPREFIX}" in the script won't work any more.  EPREFIX shouldn't change throughout the lifetime of a Prefix, as it's hardcoded here and there (in the dynamic loader path most significantly), so it should be okay to embed it in the script directly.
Comment 1 Matt Turner gentoo-dev 2019-04-09 16:12:14 UTC
prefix@: please advise. The patch seems reasonable to me, but I'm not knowledgeable about prefix matters.
Comment 2 Fabian Groffen gentoo-dev 2019-04-10 08:46:14 UTC
matt, I would suggest just restoring the original sed in src_prepare, and use prefix eclass to deal with the offset:

--- a/app-shells/autojump/autojump-22.5.3.ebuild
+++ b/app-shells/autojump/autojump-22.5.3.ebuild
@@ -5,7 +5,7 @@ EAPI=6
 
 PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
 
-inherit bash-completion-r1 python-r1 vcs-snapshot
+inherit bash-completion-r1 python-r1 vcs-snapshot prefix
 
 DESCRIPTION="change directory command that learns"
 HOMEPAGE="https://github.com/wting/autojump"
@@ -24,13 +24,14 @@ DEPEND="${PYTHON_DEPS}"
 
 src_prepare() {
        eapply_user
-       sed -e "s: \(/etc/profile.d\): \"${EPREFIX}\1\":" \
-               -e "s:/usr/local/share:/usr/share:" \
+       sed -e "s:/usr/local/share:/usr/share:" \
                -i bin/autojump.sh || die
 
        # autojump_argparse is only there for Python 2.6 compatibility
        sed -e "s:autojump_argparse:argparse:" \
                -i bin/autojump || die
+
+       hprefixify -q '"' -w '/usr\/share/' bin/autojump.sh
 }
 
 src_compile() {
Comment 3 Matt Turner gentoo-dev 2019-04-10 17:30:18 UTC
Thanks Fabian. Feel free to commit that. I can do it in a few days otherwise.
Comment 4 Larry the Git Cow gentoo-dev 2019-04-11 08:07:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e90abf4be37ca322749be5f0f088f6c07ee20b82

commit e90abf4be37ca322749be5f0f088f6c07ee20b82
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-04-11 08:06:42 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-04-11 08:06:58 +0000

    app-shells/autojump: fix patching for Prefix
    
    Closes: https://bugs.gentoo.org/665270
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>
    Package-Manager: Portage-2.3.62, Repoman-2.3.11

 app-shells/autojump/autojump-22.5.3.ebuild | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)