How about adding a function to retrieve bashcompletion dir? The default completion dir for >=bash-completion-2 is "/usr/share/bash-completion/completions" (version bump request in bug 395091), which is used by default by many apps now. Several ebuilds currently change this path to hardcoded "/usr/share/bash-completion", and many ebuilds simply do something like this: rm -rf "${ED}"/usr/share/bash-completion dobashcomp path/to/bashcomp Some examples: 1. http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/systemd/systemd-201.ebuild?r1=1.16&r2=1.17 2. gnome-base/gnome-control-center: sed -i 's|^completiondir =.*|completiondir = $(datadir)/bash-completion|' \ shell/Makefile.am || die "sed completiondir failed"
AFAIU ulm is against introducing such a function.
Well, I simply don't understand the rationale for it. Why would we need a function for something that's unlikely to ever change?
(In reply to comment #2) > Well, I simply don't understand the rationale for it. Why would we need a > function for something that's unlikely to ever change? Well, one reason is that the 'ever' we're talking about is coming up in big steps. Not that I think it's the best solution but possibly one allowing us to switch while controlling it.
Yes. How an upgrade to bash-completion-2* will be handled?
(In reply to comment #0) > The default completion dir for >=bash-completion-2 is > "/usr/share/bash-completion/completions" Hmm.. It seems this dir is also default for bash-completion-1*, but ebuilds completely ignoring build system and install everything using doins().
Please ignore my previous comment. Just checked RHEL5, RHEL6 and Debian 6. RHEL 5/6: completions installed in /usr/share/bash-completion, bash-completion version 1.3 Debian 6: completions installed in /etc/bash_completion.d/, bash-completion version 1.2 But all modern distros now uses bash-completion-2 and installs completions in /usr/share/bash-completion/completions (Fedora, Debian 7, etc).
I still don't understand how this is related to bash-completion version 1 or 2, but maybe someone can explain to me what I am missing here? Currently, bash-completion looks for completion scripts in /etc/bash_completion.d (system) and ${HOME}/.bash_completion.d (user). The only tool that looks for the scripts in /usr/share/bash-completion is the bashcomp eselect module, which creates symlinks in the bash_completion.d dir for the ones that the user enables.
AFAIK bash-completion-2 loads all comletion modules dynamically from files /usr/share/bash-completion/completions/${command_name} and bashcomp eselect module is not needed.
I've committed the initial get_bashcompdir() as discussed on the ml.