Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 531386

Summary: >=app-shells/bash-completion-2.1 automatically loads new completions
Product: Gentoo Linux Reporter: Adrian <adrian>
Component: Current packagesAssignee: Michał Górny <mgorny>
Status: RESOLVED WORKSFORME    
Severity: normal CC: adrian, shell-tools
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Adrian 2014-12-02 00:19:55 UTC
When no bash completions are enabled (via `eselect bashcomp`), the /usr/share/bash-completion/.pre file is never sourced. This means the autoloading magic is not enabled either.
However, enabling *any* bashcomp module via eselect causes the .pre file to be loaded, too, so the magic is there.

This is extremely confusing and not what one would expect.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-02 08:49:16 UTC
It's a feature.
Comment 2 Adrian 2014-12-02 10:43:25 UTC
It's not the autoloading itself this bug is about but the fact that I need to enable **some** completion to get this behaviour, which is a) not documented, b) not expected (why do I enable a random completion to get all of them).
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-02 10:59:34 UTC
This is weird. Which version of bash-completion are you using (with -r* part), exactly?
Comment 4 Adrian 2014-12-02 11:03:55 UTC
2.1-r2; it's a freshly installed system so there's no clutter from old versions etc.

I checked /etc/profile.d/bash-completion.sh and according the code there fits with what I noticed. the pre file is only loaded if there are other files to load
Comment 5 Michael Orlitzky gentoo-dev 2014-12-06 18:52:56 UTC
(You may want to reopen this so that it doesn't get lost.)
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-06 19:49:55 UTC
We don't really support autoloading prior to bash-completion-2.1-r90. In the earlier versions, you are required to enable all necessary completions via eselect.