Steps to reproduce: $ autojump Traceback (most recent call last): File "/usr/bin/autojump", line 41, in <module> from autojump_argparse import ArgumentParser ImportError: No module named 'autojump_argparse' I also see that there are probably some files missing: "equery files autojump" doesn't show any Python file that would implement ArgumentParser.
Created attachment 410876 [details] emerge --info
I altered the ebuild so it also installs the needed python files. Attached is a patch for that.
Created attachment 410908 [details, diff] Ebuild Patch
Thanks, that fixes the problem.
I've verified the patch works on 3 different Gentoo machines. Can you release a new version? I'm also attaching a full ebuild for convenience.
Created attachment 410968 [details] autojump-22.2.4-r1
I've also create a pull request: https://github.com/gentoo/gentoo/pull/66 Don't know if that's the right way to get the ebuild accepted.
*** Bug 559684 has been marked as a duplicate of this bug. ***
commit 0feaaac (HEAD, master) Merge: e1e3fe1 fb6b7aa Author: Patrice Clement <monsieurp@gentoo.org> Date: Mon Sep 7 11:39:47 2015 +0000 app-shells/autojump: Merge 'github/pr/66'. Fixes bug 559448.
The problem still persists is autojump is built with USE=-python. What is the reason to keep that flag if autojump is useless without python? And BTW - Changelog has not been updated for the last commits.
(In reply to Tomasz Golinski from comment #10) > The problem still persists is autojump is built with USE=-python. What is > the reason to keep that flag if autojump is useless without python? > > And BTW - Changelog has not been updated for the last commits. USE=python apparently controls ipython integration. It confused me as well.
That is true now in -r2. In -r1 using -python broke the install. However now -r2 is even more broken! 1) /etc/profile.d/autojump.sh looks for scripts in /usr/local 2) there are no bash scripts, only autojump.zsh. And still no update in the changelog, previous version is gone. It seems that maintainer is doing more harm than good at the moment.
Sorry about 1). Checked it before I run etc-update. However still no bash version of the script gets installed. That probably leads to the warning: * Problems with installed bash completions were found: * * autojump: incorrect name, no completions for 'autojump' command defined. * j: missing alias (symlink) for completed command. * * For more details on installing bash-completions, please see: * https://wiki.gentoo.org/wiki/Bash/Installing_completion_files
(In reply to Tomasz Golinski from comment #13) > Sorry about 1). Checked it before I run etc-update. However still no bash > version of the script gets installed. > > That probably leads to the warning: > > * Problems with installed bash completions were found: > * > * autojump: incorrect name, no completions for 'autojump' command > defined. > * j: missing alias (symlink) for completed command. > * > * For more details on installing bash-completions, please see: > * https://wiki.gentoo.org/wiki/Bash/Installing_completion_files I am the one responsible for -a2, but I'm not the maintainer. I made a pull request a couple of days ago (https://github.com/gentoo/gentoo/pull/87), got a lot of feedback and improved many things in the ebuild. It was suggested to me that there is a new way of installing bash completion, so I made a patch doing that https://github.com/lukipuki/gentoo/commit/3c5fbd4b17df82fd7ad99d88dbd0491dc9d463ca I said that I'm not a bash user and I can't test the completion (https://github.com/gentoo/gentoo/pull/87#issuecomment-139857736) but my patch got merged anyway. Too bad they didn't wait for someone to test it. Sorry for the mess. It would be great if we got the bash completion to work with the new installation procedure. If you have ideas how to fix it, I'll be happy to make a new pull request.
The line "doins bin/${PN}.bash" which you removed in "use newbashcomp" commit is not related to bash completion, but to bash part of autojump itself. Thus -r2 doesn't work at all with bash due to missing loading scripts. And let me note that bash completion script seems to be installed correctly as /usr/share/bash-completion/completions/autojump.
(In reply to Tomasz Golinski from comment #15) > The line "doins bin/${PN}.bash" which you removed in "use newbashcomp" > commit is not related to bash completion, but to bash part of autojump > itself. Thus -r2 doesn't work at all with bash due to missing loading > scripts. No, autojump is a Python program, it doesn't need bash to run. Previously, the file was installed only when the old bash-completion flag was set: https://github.com/lukipuki/gentoo/commit/28c2d4a5b24c4fccb4e5acf58088d1a6887a62f5#diff-364138cf1fe4a2d01021c945c17349b8L45 I think we need to run 'bashcomp_alias' for the 'j' command (according to the second item in https://wiki.gentoo.org/wiki/Bash/Installing_completion_files). Can you check this ebuild: http://lukas.vms.6com.net/~lukas/autojump-22.2.4-r3.ebuild ? There is an extra line 'bashcomp_alias autojump j'.
I agree that autojump is python program and does not require bash to run. But in order to use it usual in bash, it needs to set certain aliases. It's done via /etc/profile.d/autojump.sh which runs a correct alias-setting script depending on the active shell: source /usr/share/autojump/autojump.${shell}. In case of bash, it fails as there is no corresponding file. In my understanding of things, bash-completions are a different thing altogether - they should only make bash understand that "j" is a command which should be followed by a directory name. Right now, both in -r2 and your new ebuild, alias "j" doesn't get defined (unless I'm doing something really wrong) and running autojump directly produce: "Please source the correct autojump file in your shell's startup file. For more information, please reinstall autojump and read the post installation instructions."
(In reply to Tomasz Golinski from comment #17) > I agree that autojump is python program and does not require bash to run. > But in order to use it usual in bash, it needs to set certain aliases. It's > done via /etc/profile.d/autojump.sh which runs a correct alias-setting > script depending on the active shell: source > /usr/share/autojump/autojump.${shell}. In case of bash, it fails as there is > no corresponding file. > > In my understanding of things, bash-completions are a different thing > altogether - they should only make bash understand that "j" is a command > which should be followed by a directory name. > > Right now, both in -r2 and your new ebuild, alias "j" doesn't get defined > (unless I'm doing something really wrong) and running autojump directly > produce: > > "Please source the correct autojump file in your shell's > startup file. For more information, please reinstall autojump > and read the post installation instructions." I didn't get this error when I ran bash from my regular zsh terminal, but I did get it when trying "sudo bash". I have now added back the line "doins bin/${PN}.bash". Please try again: http://lukas.vms.6com.net/~lukas/autojump-22.2.4-r3.ebuild If it works, I'll make a new pull request. By the way, the previous ebuild only installed the .bash file when bash-completion was set, so it was broken for people not wanting completion.
Now it works but I'm not sure if it is the correct way as the same file gets installed in two places: /usr/share/bash-completion/completions/autojump and /usr/share/autojump/autojump.bash However I still get the warning: * Problems with installed bash completions were found: * * autojump: incorrect name, no completions for 'autojump' command defined. * * For more details on installing bash-completions, please see: * https://wiki.gentoo.org/wiki/Bash/Installing_completion_files * If it worked for you in some cases before, it may mean that I have something broken in my setup. Bash-comp files are probably not parsed. However, they shouldn't need to be enabled for autojump to work. Currently, it seems that for some people the config file will be parsed twice...
I've made a new PR, the bash file is installed and no bash completion files are installed: https://github.com/gentoo/gentoo/pull/121