The ebuild installs /usr/share/bash-completion/completions/pass-otp
This file is not a stand-alone bash-completer but adds functions to the existing pass completer.
It needs to be installed to /etc/bash_completion.d/pass-otp in order to function correctly.
This can be fixed by removing BASHCOMPDIR="$(get_bashcompdir)" from the emake call or by replacing it with BASHCOMPDIR="/etc/bash_completion.d" - which is the upstream default.
/usr/share/bash-completion/completions is the default install location for packages. Istead of moving the file to some location whereit is not supposed to be installed by portage, the completion file should be fixed to work independently from its location.
sorry, I thought /etc/bash_completion.d is valid location, as app-shells/gentoo-bashcomp installs its gentoo-style-init there too.
pass-otp is not a bash-completion script but only a function definition to be used by the bash-completion script.
I don't think bash-completion can handle multiple completers for a single command (here: "pass").
Feel free to close this.
I ran into this exact problem.
I have an Artix machine also running pass-otp. It installs the very same bash completion file (as also to be found upstream), and it puts it in /etc/bash_completion.d/. On Artix, it works out of the box, in contrast to the ebuild's approach.
As pass-otp is a pass plugin and the completion is also only an extension to the existing pass completion definition, I think this one can't live on it's own by defintion, as it's not a complete completion file -- the "otp" part is only a new "pass" parameter, so I don't think it would be even possible to have a stand-alone completion definition, is it?!
The fact that bash completion itself sources /etc/bash_completion.d/ and "pass otp" completion works as soon as the upstream file is put there leaves the impression to me that, in fact, /etc/bash_completion.d/ _is_ a standard place to put this very "plugin" type of definitions.
Would be nice if this was fixed. IMO this is not an upstream issue, but a Gentoo downstream one.
Created attachment 870013 [details]
Fixed ebuild for app-admin/pass-otp-1.2.0