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

Bug 70329

Summary: skel .bashrc should also include code for per-user bash-completions
Product: Gentoo Linux Reporter: Aaron Walker (RETIRED) <ka0ttic>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED INVALID    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Aaron Walker (RETIRED) gentoo-dev 2004-11-07 00:40:53 UTC
Now that it is possible to have per-user bash completions installed via bash-completion-config, the skel .bashrc provided by baselayout should include code to source any files in ~/.bash_completion.d (commented out by default, of course).

Something like the following:

[ -d ~/.bash_completion.d ] && for i in ~/.bash_completion.d/*; do [ -f $i ] && . $i; done
Comment 1 SpanKY gentoo-dev 2004-11-07 22:27:07 UTC
the following is already in skel's bashrc:

# uncomment the following to activate bash-completion:
#[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion

why cant this suggested enhancement be added to that file instead ?
Comment 2 Ciaran McCreesh 2004-11-08 00:22:46 UTC
/etc isn't per-user.
Comment 3 Aaron Walker (RETIRED) gentoo-dev 2004-11-08 05:33:06 UTC
heh that was my original idea but I didn't think it would work (obviously I wasn't alone ;p).  

$ tail /etc/profile.d/bash-completion
if [ "$PS1" ] && [ -d ~/.bash_completion.d ] ; then
    for file in ~/.bash_completion.d/* ; do
        [ -f $file ] && source $file
    done
fi
$ echo lala="LALALALALALALA" > ~/.bash_completion.d/lala
$ . /etc/profile.d/bash-completion
$ echo $lala
LALALALALALALA

Sorry for the spam guys...
Comment 4 SpanKY gentoo-dev 2004-11-09 21:54:04 UTC
i didnt say /etc was per-user, but if the global bash-completion does a per-user check like Aaron suggested ...